The Wayback Machine - https://web.archive.org/web/20200716113310/https://github.com/visgl/react-map-gl/issues/1044
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 have a custom marker in a cluster example? #1044

Open
gajus opened this issue Mar 4, 2020 · 3 comments
Open

How to have a custom marker in a cluster example? #1044

gajus opened this issue Mar 4, 2020 · 3 comments

Comments

@gajus
Copy link

@gajus gajus commented Mar 4, 2020

These two examples demonstrate two features that I want:

  • clustering
  • custom marker

I understand how styling of layers work in the cluster example, though I don't understand how to add markers to a layer. In the cluster example, I wish to have a custom marker for unclusteredPointLayer.

@tbakerx
Copy link

@tbakerx tbakerx commented Mar 10, 2020

Have a look at making it a type:'symbol'
https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#symbol

@yardiewizardie
Copy link

@yardiewizardie yardiewizardie commented Mar 15, 2020

Hey @gajus , I had similar implementation as yours, I'm happy I figure out things, I would like to help you because there is little documentation about this.

Customization can be tricky, but you should focus on the mapbox docs, what worked for me are.
https://docs.mapbox.com/mapbox-gl-js/example/data-driven-circle-colors/ for custom color markers, for custom marker, they can be pretty limited, but symbol are working for me. My point is that to look for documentation in mapbox itself not the react-map-gl.... As for popup and other interaction with those, do use the onClick or getCursor function of MapGL, they are useful to interact with them. Hope this helps.

@webdeb
Copy link

@webdeb webdeb commented May 31, 2020

@gajus Could you find a satisfying solution to render markers with clustering. me not yet.
Right now I am using the layers of unclustered / clustered points, which works but its limited in capabilities of the actual feature points (like applying styles programmatically etc.)

On the other hand I could use markers, but I could not find any clustering examples.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.