Skip to content

Difference between many Marker components and Source/Layer components #1511

Answered by Pessimistress
wfendler asked this question in Q&A
Discussion options

You must be logged in to vote

~100 Marker components should work fine if you use useMemo. The main advantage of the React component is that you can define its content with arbitrary DOM and CSS, while a symbol layer's styling options are relatively limited. If you have hundreds of markers or more, it's definitely more performant to use source/layer, because the React component needs to update its position on every viewport change, while the layer is (I believe) cached by tile and is not as expensive to rerender.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wfendler
Comment options

Answer selected by wfendler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants