-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker's icon is not always present #172
Comments
I can't think of how this could happen? The icon should be initialized when it is added to the map and (besides CircleMarker's) as far as I know markers are not removed from the map when offscreen. Do you have a case where you are hitting the error? If you could run up a jsfiddle that would be great! |
Will try to get a more precise test case today! This is coming in through exceptions caught on geojson.io so I didn't experience it directly, just saw the code path. |
@tmcw could you please check to see if you are still seeing the error with the latest build. I've added a small check to see if |
Testcase: this happens when your |
In this bit of code: https://github.com/Leaflet/Leaflet.draw/blob/master/src/edit/handler/EditToolbar.Edit.js#L135-L153 Leaflet.draw makes the assumption that the L.Marker layers in the map will always have a
_icon
private member. This assumption is broken in some cases, including (I think) when markers are offscreen or added to the map without an icon specified. In this case, a TypeError is thrown and not caught.The text was updated successfully, but these errors were encountered: