Services Plugins FAQs

Loading too many mapbox markers is crashing the app

Hi, I’ve got over 3,000 markers to add to the mapbox map. And trying to load them all at once is incredibly slow/crashes the app.

So I’m looking at the best way to dynamically load them but I can’t work out how to do it.

I’m thinking that only markers within a 2 mile radius of the map’s centre location, and when at a certain zoom level, will load a feasible numbers of markers at any one time.

Would that be possible?

I’ve also tried to work out the Clusters functionality but I can’t!
Would clusters be a better option here?

Many thanks.

Hello @londonbikebays,

Thank you for reaching out.

Handling the Latitude, Longitude, Marker ID, and Icon for over 3000 markers is indeed substantial for Bubble. Implementing a limit might enhance the performance and prevent potential app crashes in the future.

Could you specify the challenges you faced while setting up the Marker Clusters so we understand how to assist you better?

Best regards,
Dorel

Hi Dorel,

Thanks for offering to assist.

Maybe clusters is the answer - I found this: 🗺 Mapbox Maps - Total revamp of one of the most popular Bubble plugins from Zeroqode - #114 by ZeroqodeSupport - Plugins - Bubble Forum

But I can’t seem to understand how this set up works. Are the markers (3000+) supposed to be in the GeoJSON?

I’ve tested loading the markers and about 100 at a time is reasonably responsive. Would there be a way to set each cluster to load maximum 100 markers?

Many thanks,
Tom

Hello @londonbikebays

I’ve consulted with the plugin developer regarding your concern. Here’s their insight:

To visualize all the markers within clusters, you’ll need to incorporate them all into the GeoJSON file. However, as a potential solution to your app’s stability issues, you might consider creating several smaller clusters, perhaps with about 100 markers each, and subsequently integrating them into your application.

I’m sorry we couldn’t provide a more straightforward solution, but I hope this workaround helps.

Cheers :hugs:

Ok thanks that makes sense.

Just so I’m clear, would this mean I delete the markers from the Bubble Dataset and use the GeoJSON file instead? Or should the markers be in both?

Many thanks

@londonbikebays

Indeed, all the marker data resides within the GeoJSON file. This allows you the flexibility to remove them from Bubble’s database if you’ve stored them there.

Should you have further questions or need clarification, please don’t hesitate to reach out either here or directly at support@zeroqode.com.

Cheers :hugs: