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

Save extra data to marker (or layer) #58

Open
steosoft opened this issue Aug 29, 2018 · 5 comments
Open

Save extra data to marker (or layer) #58

steosoft opened this issue Aug 29, 2018 · 5 comments

Comments

@steosoft
Copy link

It should be possible to add custom extra data to marker.
In original library we can do it just by passing key-value while creating marker object.
Is it possible to add this function to library?

@mstahv
Copy link
Owner

mstahv commented Oct 9, 2018

You can extend Marker class and create a custom version. Then you can add either well typed api for properties you know or even expose a map like API if you really need that.

@octavm
Copy link
Contributor

octavm commented Oct 10, 2018

Have you thought about using the setData() method of LMarker, inherited from AbstractComponent?

@mstahv
Copy link
Owner

mstahv commented Oct 10, 2018

I guess @steosoft is using this in GWT application? The setData suggested by @octavm only in the Vaadin integration side. Even there I'd suggest to create the extensions for better typed and documented API.

@octavm
Copy link
Contributor

octavm commented Oct 10, 2018

@mstahv you're right. I wasn't paying attention, just now I noticed this is for g-leaflet.

@steosoft
Copy link
Author

Yes, I'm using it in GWT application. I've changed my code so I don't need passing extra data anymore but good to know how to do that in the future. Thank you.

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

3 participants