forked from 0x2620/oxjs
more fixes
This commit is contained in:
parent
bcade5f2d7
commit
f3e0632f0e
4 changed files with 39 additions and 16 deletions
|
|
@ -46,6 +46,7 @@ Ox.MapRectangleMarker = function(options) {
|
|||
type: that.place.id[0] == '_' ? 'result' : 'place'
|
||||
}),
|
||||
});
|
||||
that.marker.setLngLat(that.place.points[that.position])
|
||||
|
||||
function dragstart(e) {
|
||||
Ox.$body.addClass('OxDragging');
|
||||
|
|
@ -101,10 +102,13 @@ Ox.MapRectangleMarker = function(options) {
|
|||
add <f> add
|
||||
@*/
|
||||
that.add = function() {
|
||||
that.marker.setMap(that.map.map);
|
||||
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);
|
||||
*/
|
||||
};
|
||||
|
||||
/*@
|
||||
|
|
@ -112,21 +116,26 @@ Ox.MapRectangleMarker = function(options) {
|
|||
@*/
|
||||
that.remove = function() {
|
||||
that.marker.remove();
|
||||
google.maps.event.clearListeners(that.marker);
|
||||
console.log("remove marker, fix events")
|
||||
//google.maps.event.clearListeners(that.marker);
|
||||
};
|
||||
|
||||
/*@
|
||||
update <f> update
|
||||
@*/
|
||||
that.update = function() {
|
||||
that.marker.setOptions({
|
||||
icon: Ox.MapMarkerImage({
|
||||
marker = new maplibregl.Marker({
|
||||
cursor: that.position + '-resize',
|
||||
draggable: true,
|
||||
element: Ox.MapMarkerImage({
|
||||
mode: 'editing',
|
||||
rectangle: true,
|
||||
type: that.place.id[0] == '_' ? 'result' : 'place'
|
||||
}),
|
||||
position: that.place.points[that.position]
|
||||
});
|
||||
marker.setLngLat(that.place.points[that.position])
|
||||
that.marker.remove()
|
||||
that.marker = marker
|
||||
};
|
||||
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue