I have a an OS Maps that shows two points.
Is there a way to prevent user from dragging the direction set?
Hello @Win Signo.
I was able to replicate the use case you mentioned, and it's by design.
As a workaround, you can add a JavaScript Node to disable the possibility of dragging the route and creating new markers.
For that, place a JavaScript Node after the LoadLeafletDirectionsPlugin
In the JavaScript Node, place the following:
OutSystems.Maps.MapAPI.MapManager.GetActiveMap().features.directions._directionsRenderer.options.lineOptions = { addWaypoints: false }
Hi @Win Signo ,
If you are using OS Maps and the markers in them,. Then there is an option "AllowDrag" which if you set it to false. It will prevent the marker from being dragged.
Check OML for reference to above given image.
If you are using external JS to define the direction set, then you should try the handlers of the markers given in the Leaflet documentation here.
Some more links :
https://stackoverflow.com/questions/22671733/why-doesnt-marker-dragging-disable-work
Hi @Rishabh Tailor
The issue that I have is the usage of the destination on leaflet, on my example i have 2 marker and I use SetDirections and the red lines would appear. The issue that I'm facing it that I can prevent the user from moving my 2 markers, but once they click the red line, it will automatically create a new marker once i set it. You can look at example i have, first I have A-B marker which is the solid red line, but when i click that red line and drag it, it would create a new B marker which will show with the break line, it sort of a new waypoint being added.
First I have two points A-B, these marker are not draggable, and I trigger the SetDirection to create a path from A-B
Next, I hold the line created and dragged it. (This is the part that I want to remove, which is allowing the user to drag the line and create a new marker)
Once I placed down, the map would tag the newly drop point as a new marker.