w8r / Leaflet.Bookmarks

Leaflet plugin for user-generated bookmarks
http://w8r.github.io/Leaflet.Bookmarks/
59 stars 17 forks source link

Option for more information #2

Open tdaubs opened 9 years ago

tdaubs commented 9 years ago

Really nice work on this add-on for Leaflet. Small feature request. It would be great to see an additional option for a note that would populate the infowindow beyond just the title.

w8r commented 9 years ago

@tdaubs, as mentioned in the docs, you can define your own data structure for a bookmark, the only required field being latlng. You can change the bookmark form, data extraction from it (options.formPopup.template and options.formPopup.getBookmarkData), as well as bookmark popup.

{
    popupTemplate: '<div><h3>{{ name }}</h3><p>{{ latlng }}</p>'
}

Storage is fully under your control as well. If it sounds too complex or foggy, I can try and add an example of customisation.

tdaubs commented 9 years ago

Yes, an example would be great! Maybe a description field or note field or similar.