this is approximate. (I’m doing it from memory.) That is, it has been debugged.
var myPopOne = L.popup().setLatLng([0,0]).setContent(’some text);
var myPopTwo = L.popup().setLatLng([10,10]).setContent(’some text 2);
>
> function addThePopup(whichPopup) {
> myMap.addlayer(whichPopup)
> }
>
> You will also need to know when the user clicks the link. You can add something like this to each of your <a> tags
>
> onclick=“addThePopup(myPopOne)”
> onclick=“addThePopup(myPopTwo)”
>
Then to get it working when the user clicks the marker, instead of binding the popup to the marker, you will need to listen for an event when the user clicks the marker. I have never done this, so you will have to research it.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Leaflet" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
leaflet-js+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/leaflet-js/32fa4acc-21e9-4873-b129-b758b60a91e4n%40googlegroups.com.