-
Notifications
You must be signed in to change notification settings - Fork 52
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
multiple map support #20
Comments
Sorry, I'm no longer actively maintaining the plugin. Maybe it's fixed in one of the forks or you could ask for help in the general Leaflet community. |
Did you found any solution ? I have the same problem. Thanks! |
As far as I get it: There's a (somehow fixed) renderer defined in the default options that will always use the same canvas (as L.hotline(latLngs, {
renderer: L.Hotline.renderer()
// ...
}) |
Thanks @laufhannes ! Now it works! |
When dealing with multiple maps, the hotline canvas will be added to the very last map only.
I've put a simple demo of that in a fiddle: https://jsfiddle.net/chris_farnleitner/t45jh23a/7/ (when using the zoom controls you can see that both hotlines are actually drawn on the same map).
The very same concept does work when using polyline instead of hotline - any ideas how to overcome this issue?
In general I'm wondering, how a canvas is added to a map - i.e. there is a
var canvas = document.createElement("canvas") [...]
andthis._canvas = canvas = typeof canvas === "string" ? document.getElementById(canvas) : canvas;
, but this somehow does not add up to me (especially, because 'canvas' is always an object (without an particular id) and so 'typeof canvas === "string"' does also never becomes true).The text was updated successfully, but these errors were encountered: