1
0
Fork 0
forked from 0x2620/oxjs

one layer per rectangle to redouce events

This commit is contained in:
j 2025-08-06 23:31:07 +02:00
commit 80d3919b46
3 changed files with 18 additions and 19 deletions

View file

@ -103,12 +103,9 @@ Ox.MapRectangleMarker = function(options) {
@*/
that.add = function() {
that.marker.addTo(that.map.map);
console.log("add marker, fix events")
/*
google.maps.event.addListener(that.marker, 'dragstart', dragstart);
google.maps.event.addListener(that.marker, 'drag', drag);
google.maps.event.addListener(that.marker, 'dragend', dragend);
*/
that.marker.on('dragstart', dragstart);
that.marker.on('drag', drag);
that.marker.on('dragend', dragend);
};
/*@
@ -124,7 +121,7 @@ Ox.MapRectangleMarker = function(options) {
update <f> update
@*/
that.update = function() {
marker = new maplibregl.Marker({
var marker = new maplibregl.Marker({
cursor: that.position + '-resize',
draggable: true,
element: Ox.MapMarkerImage({