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

Added text option so you can have numbered/lettered markers #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jlyon
Copy link

@jlyon jlyon commented Jul 24, 2013

I wanted to create numbered and lettered markers rather than using fontawesome icons. This fork adds support for a text option that you can use instead of icon when calling L.AwesomeMarkers.icon. It also adds a textFormat option. If textFormat = 'letter', a number is converted to a letter and displayed in the marker (0=A, 27=AA, etc).

Example usage:

num = 1;
var marker = L.marker([item.Latitude, item.Longitude], {
icon: L.AwesomeMarkers.icon({
text: num,
textFormat: 'letter',
color: 'blue'
}),
});

// The letter used in the marker (B)
console.log(marker.options.icon.num2letter(num));

@zavan
Copy link

zavan commented Oct 20, 2015

Will anything like this ever gonna be merged?
I have some use cases.

#54 #29

@MaxiBerdy
Copy link

MaxiBerdy commented Apr 21, 2021

2021 and I would like to use such a feature as well. This library is great when you are building a Leaflet map visualization and need some custom markers. But I prefer the solution from #54 since it is more general (having an HTML field where you can put any html element instead of using a number to represent a character)

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

Successfully merging this pull request may close these issues.

3 participants