question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cluster component only shows children when single marker is within map bounds

See original GitHub issue

When implementing Markers nested within the Cluster component, the child markers are not rendered unless they’re the only marker within the maps bounds. Instead, the ClusterMarkerFactory is called to return the clustered marker.

Should clusterThreshold determine if theClusterMarkerFactory is used, or the children Marker’s are rendered?

I’m trying to implement clustering similar to this example (but with marker positions passed down to the map via props, without a data source URL): https://www.mapbox.com/mapbox-gl-js/example/cluster/

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mark2685commented, Feb 28, 2017

Hi @alex3165, I worked it out using the Source and multiple Layer components.

I’ll keep messing the the Cluster component, but closing this out for now.

Thanks!

0reactions
mark2685commented, Mar 1, 2017

Hi @alex3165, if I went that route, wouldn’t I have three Layer components, with the same collection of Feature components mapped out for each Layer component?

I thought that creating a single Source component, and referencing that via the sourceId prop on the Layer components would be better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Points and Clusters not showing as intended near map's ...
I'm having an issue on my React Google Maps implementation. I have been able to display all my points correctly on the map...
Read more >
Get a list of leaflet marker clusters within current map bounds ...
It seems there is no exposed or internal method or array for enumerating current marker clusters. The only useful method seems to be...
Read more >
Clustering data in Google Maps and React - YouTube
In this video we will create a Google Map in React, loading remote data from an API, clustering it, and then zooming in...
Read more >
Leaflet.markercluster - Shenchen Liu's website
The method will look for all markers in it. Make sure it contains only markers which are also within this Marker Cluster Group....
Read more >
React Google Maps Api Style Guide
Whether to ignore hidden markers in clusters. You may want to set this to true to ensure that hidden markers are not included...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found