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

Add setContent and getContent API for L.divIcon class #4259

Open
badazz91 opened this issue Feb 18, 2016 · 5 comments
Open

Add setContent and getContent API for L.divIcon class #4259

badazz91 opened this issue Feb 18, 2016 · 5 comments

Comments

@badazz91
Copy link

Similar to the L.popup class it would be nice to provide methods like setContent and getContent for L.divIcon, for better implementation of custom icons. Also it would be nice to be able to set also DOM elements, instead of only a html string in L.divIcon.

@IvanSanchez
Copy link
Member

I'm not really sure this is a good idea - the code for L.Icon expects to have control over the HTMLElement of the icon, so it can be repositioned. While this is a good idea, I don't think implementation would be trivial.

@miguelcobain
Copy link
Contributor

@IvanSanchez why would this be difficult for icons and not for popups/tooltips?

@aeromac
Copy link

aeromac commented Aug 22, 2019

I'm not sure what version it was implemented, but div icon now accepts HTMLElement.

html = String|HTMLElement
"Custom HTML code to put inside the div element, empty by default. Alternatively, an instance of HTMLElement."

@JaZo
Copy link

JaZo commented Aug 22, 2019

@aeromac Nice, you are correct! 😃 HTMLElement support was introduced in 1.5.0 (see https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#150-2019-05-08) with #6571. So this issue is partially fixed, but setContent and getContent are yet to be implemented.

@Malvoz Malvoz changed the title Add setContent and getContent API for L.divIcon class Add setContent and getContent API for L.divIcon class Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@miguelcobain @IvanSanchez @JaZo @badazz91 @aeromac and others