Hello.
Is it possible to change location of a marker dynamically (by an event)? I didn't find changeMarker of deleteMarkr functions in the plugin.
Stefano Valente wrote:
Do you mean by dragging the marker ?
I mean by changing lat, lon parameters of marker.
I found out in the documentation to the LeafletJS library that there is a method setLatLon of the object Marker.
First careate js script text:
"var myLatLonObject = L.latLng(" + EncodeJavaScript(MyLocation.Latitude) +", " + EncodeJavaScript(MyLocation.Longitude) + "); " + EncodeJavaScript(MyPositionMarkerName) + ".setLatLng(myLatLonObject);"
Second run this script by eval($parameters.Script);
Is works.
You can delete the previously created marker, before creating a new one by adding below code in AddMarker
If(DeleteOldMarker, (EncodeJavaScript(LeafletMapName) + ".removeLayer("+EncodeJavaScript(Marker.Name) +");"),"")
You can also use the Hide and Show actions
I'll try to free up some time this weekend and update the component to include this function :)