Skip to content
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

let programmer specify the id of the icon #82

Open
mfrasca opened this issue Dec 21, 2016 · 0 comments
Open

let programmer specify the id of the icon #82

mfrasca opened this issue Dec 21, 2016 · 0 comments

Comments

@mfrasca
Copy link

mfrasca commented Dec 21, 2016

(disclaimer: I'm not a JS programmer, I generally work with C/C++, Python, Pascal)
my understanding is that when you create a marker and you add it to a map, an icon is created and put in the DOM. I am building a user interface (http://gardens.ghini.me / http://github.com/Ghini/ghini.web) that would let the user select items on the map and I want to highlight their selection. I am thinking of achieving this by the element id and a jquery selector. my element id comes from a database.
is there a deeper reasoning behind the fact that we cannot do this?

this does not work:

    var marker = L.marker([item.lat, item.lon],
                          item);
    marker.addTo(l).bindPopup(models[g].text.formatU(item),
                              {marker: marker});
    var marker_id = generate_guid(item._id);
    marker._icon.id = marker_id;

because the _icon property of the marker is not immediately available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant