Closed dbielak closed 4 years ago
Get this resolved? Im having the same issue.
I found solution by addding if condition before line no. 659
I added this condition at couple of places, so the condition is
if(icon){ // code }
Unfortunately, the problem still exists.
This issue was solved in https://github.com/hosuaby/Leaflet.SmoothMarkerBouncing/pull/23
Error "Uncaught TypeError: Cannot read property 'style' of undefined at makeMoveStep (leaflet.smoothmarkerbouncing.js:659)" was due to the fact that method bounce()
was called before addTo(map)
.
Here is a working code snippet:
marker = L.marker(latlng, {icon: personIcon})
.bindPopup(popupText)
.setBouncingOptions({
bounceSpeed: bounceSpeed,
}).addTo(map).bounce(); // <- bounce called in the end
Hi,
I am using Leaflet routing machine and the marker are created from that by dragging. If i bounce the marker then i get the style error. If i do addTo(map)
to the marker and bounce it works but then i have two markers. my repo is here https://neogeomat.github.io/MapPath/
Hello @neogeomat . I don't have example with Leaflet routing machine. The key to solve your problem is to assure that marker was successfully added to the map before call to method .bounce()
.
You you don't add marker by yourself, you need to find callback in the library that do it. It must be named something like: onMarkerAdded()
.
Hi, i have a problem with marker when is starting bouncing. It's make an error loop with message
I have a custom Icon somthing like that
Do you know what is a problem?