Closed aswinkumar863 closed 5 years ago
Hi there,
Thanks for posting it, and answering all questions on stackoverflow :)
Just added getMarker() and getMarkers() logic to all motion components.
Please let me know if any,
Regards, Igor
Thank you @Igor-Vladyka for your support. I will let you know if any :)
Hi Now your demo gives an error in getMarker method: "Uncaught ReferenceError: marker is not defined"
In /dist folder you have this code:
getMarker: function () {
if (this.markerOptions) {
if (!this.__marker) {
this.__marker = L.marker([0, 0], this.markerOptions);
if (this.markerOptions.showMarker) {
/* Here it should be this.__marker.addTo(this._map);*/
marker.addTo(this._map);
}
}
}
return this.__marker;
}
In source code it looks like:
getMarker: function () {
return this.__marker;
}
Please correct code in /dist folder
A method like
getMarker
helps to extend the marker functionality such as bind events to the Leaflet.motion's markerCurrent workaround
Expected
Related Stackoverflow questions
https://stackoverflow.com/questions/57358979/how-to-add-events-to-marker-by-using-leaflet-motion
https://stackoverflow.com/questions/57489468/how-can-the-map-be-centered-at-a-moving-marker-after-the-marker-has-been-clicked