-
-
Notifications
You must be signed in to change notification settings - Fork 71
-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Permalink / Open marker text via html link #122
Comments
I also found this related question https://wordpress.org/support/topic/ajaxjquery-to-show-more-information/ |
Check out the global JavaScript variable You ought to be able to loop through those to discover how to open a popup. I'm not exactly sure how to do it though. I would guess there's an answer on leafletjs.com |
You are right that this is a leafletjs problem itself. (See e.g. https://stackoverflow.com/a/31032786) Thanks for the hint with the What I thought of is, changing the markes array into dictionary or a list of class with the attributes Another idea would be using the internal leaflet_id each marker has but they are not known at time of creating. After the map is created, you could do something like (tested): Additionally I would propose functions like What do you think ? Edit: |
The problem is: Can we give markers ids? |
I don't see a reason why we can not. We generating HTML code and every tag is allowed to have an unique identifier (see the HTML standard). It may be reasonable to make it optional and add an additional marker option for setting the id value. Alternatively it may be a good idea to convert the option |
Hi there,
for my page it would be great to open a markers text box via a link on the page.
E.g. something like
<a href="#marker-1234">Open Marker 1234</a>
alternatively via javascript.I noticed that my marker do not get any identifier.
Another test I did was:
<img id="test" src="https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon.png" class="leaflet-marker-icon leaflet-zoom-animated leaflet-interactive" ...>
document.getElementById("test").click();
In my case the corresponding marker text opened.
My question now: Did I miss an implemented way of doing this ? If not what is your opinion on that ?
Setup:
The text was updated successfully, but these errors were encountered: