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

How to add a nice looking marker to the map? #55

Closed
dawid-niedzwiecki opened this issue Jan 23, 2023 · 6 comments
Closed

How to add a nice looking marker to the map? #55

dawid-niedzwiecki opened this issue Jan 23, 2023 · 6 comments

Comments

@dawid-niedzwiecki
Copy link

Can i somehow make a nice looking circle marker with a text on top of it directly in the map without giving it an image?

@kamami
Copy link

kamami commented Jan 23, 2023

You could make use of layers. There are a bunch of different ones

@dawid-niedzwiecki
Copy link
Author

Is there a structure that I would need to follow? How do I add some vector graphics to the mapp in code?

@kamami
Copy link

kamami commented Jan 23, 2023

Is there a structure that I would need to follow? How do I add some vector graphics to the mapp in code?

You could use symbol layers for that: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#symbol

@dawid-niedzwiecki
Copy link
Author

I'm thinking of something that looks like this:
image

Is it possible without having any image file at hand? Can I draw such markers as single features using some shapes and stuff?

@kamami
Copy link

kamami commented Jan 24, 2023

You could use two separate layers. One for the circles and the other for the text. Just like in the cluster example.

@dawid-niedzwiecki
Copy link
Author

Thanks, I managed to do it!

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

2 participants