coryasilva / Leaflet.ExtraMarkers

Custom Markers for Leaflet JS based on Awesome Markers
MIT License
331 stars 125 forks source link

Adding names to the markers. #47

Closed readingdancer closed 4 years ago

readingdancer commented 4 years ago

This PR adds two new properties to the options " name " and " nameClasses " the first is the text used for the marker name and the second is a list of one or more classes that can be added to the DIV.

This allows you to easily add names next to your markers ( you can use your own CSS to position it where ever you want it to go, i.e. above / below / at the side etc. )

I have also updated some of the dependencies as they had security warnings.

Feel free to take it or reject it :)

FYI we are using your plugin on https://nccovidsupport.org thank you for writing it in the first place, it saved us a bit of time 👍

coryasilva commented 4 years ago

Seems pretty cool, I will try to publish it tonight.

If you have time please update the resume. (Otherwise I will do when I publish)

On Mon, Apr 27, 2020, 7:35 PM Chris Houston notifications@github.com wrote:

This PR adds two new properties to the options " name " and " nameClasses " the first is the text used for the marker name and the second is a list of one or more classes that can be added to the DIV.

This allows you to easily add names next to your markers ( you can use your own CSS to position it where ever you want it to go, i.e. above / below / at the side etc. )

I have also updated some of the dependencies as they had security warnings.

Feel free to take it or reject it :)

FYI we are using your plugin on https://nccovidsupport.org thank you for writing it in the first place, it saved us a bit of time 👍

You can view, comment on, or merge this pull request online at:

https://github.com/coryasilva/Leaflet.ExtraMarkers/pull/47 Commit Summary

  • Adding names to the markers.

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coryasilva/Leaflet.ExtraMarkers/pull/47, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUMSTFU5ELCU3DKMI26KF3ROY6ITANCNFSM4MSN3JZA .

coryasilva commented 4 years ago

@readingdancer BTW the your covid mapping application looks great and seems very helpful. I especially like the filters and the svg markers -- of course ;)

readingdancer commented 4 years ago

Thanks @coryasilva I am glad you like the site, it's a labor of love as it's a voluntary open source project: NC COVID Support on GitHub

Although I am sure this PR might be useful for some people, I am now struggling to figure out how to position the labels so that when you have markers close together, the labels don't overlap ( or appear at all, probably based on an importance weighting )

We have an issue for it on GitHub which probably explains this a little better with a couple of images.

If you have any ideas, we'd welcome some help :)

coryasilva commented 4 years ago

@readingdancer Will it mess you up if I rename the name and nameClasses options to label and labelClasses?

readingdancer commented 4 years ago

Hi @coryasilva no not at all, I'm currently using the code from my fork, but once you've made your change I will probably change it to use npm so we can keep up to date more easily if you update it :)