franse
May 30, 2024, 11:21pm
1
I can see that we have a Double click
event:
But it seems, it only zooms in.
Is there other way to achieve something like this?
With js is like:
function onMapDoubleClick(e) {
var latLng = e.latlng;
marker.setLatLng(latLng);
}
map.on('dblclick', onMapDoubleClick);
map.doubleClickZoom.disable();
Thanks!
Cheese
May 30, 2024, 11:45pm
2
Now you see why the script is so large! Sorry @franse couldn't resist...
franse
May 31, 2024, 12:33am
3
Cheese:
couldn't resist...
hahah I know this will probably end on something like:
disablezoom="true"
1 Like
Cheese
May 31, 2024, 12:36am
4
I believe it is:
zoomControl: false
Man I read so much on Stack about Leaflet over the past few weeks if it were a book I think I could quote chapter, paragraph, and line number!
franse
May 31, 2024, 12:46am
5
Cheese:
zoomControl: false
I think those are for the buttons
Actually get hidden on zoom-control="false"
But still not working.
I guess some custom js doesn't hurt anyone
Yeah me too and now is here, hope everybody can find this really useful, it's a great feature
1 Like
We've not added this option to the component and the UI and it's on by default, but we can add it in the next update.
If you think there are more useful options that can be added to the UI, please let us know so we can add them.
3 Likes
You can test the following update: dmxLeafletMaps.zip (11.0 KB)
To the component add double-click-zoom="false"
to disable the double click zoom handler.
franse
June 3, 2024, 12:48pm
9
Thanks @patrick will test it later.
The dynamic events are working? Tried on click = set lang long but doesn't seem to trigger, barely tested, but will check it again
I had an test with the following mapclick event to add a marker which works fine
dmx-on:mapclick="mymap.addMarker({id: 'marker', tooltip: 'test', popup: 'Hello World', latitude: $event.latitude, longitude: $event.longitude})"
franse
June 3, 2024, 7:32pm
11
Thanks @patrick this works perfect.
But I can't set
the marker to where the mouse is, like the video I posted above.
What I need is: marker.setLatLng(latLng);
But it seems there's no dynamic actions on the marker
, all of them are only from the leaflet component.
George
June 4, 2024, 6:05am
12
Well you have to double click on the action on click on the + sign to add it first
franse
June 4, 2024, 9:48am
13
Sorry @George but, what I mean is about the marker, not the map, there's no action to place the marker to another position.
But maybe I can use dynamic lat/lng from the marker itself, instead on trying to move it, as there's no option.
Teodor
Closed
June 7, 2024, 5:00am
17
This topic was automatically closed after 8 hours. New replies are no longer allowed.