tile38
tile38 copied to clipboard
map marker clusters at scale
Is your feature request related to a problem? Please describe. Typical maps on mobile apps require clustering of markers due to the amount of points being displayed. A bunch of client-side libraries exist but scaling beyond ~50.000 points becomes a bottleneck when frequently loading, parsing, drawing markers updates from a single geojson source.
Describe the solution you'd like While investigating, i came across this article: Serve Map Clusters 50x Faster Using Smarter Caching by @FlorianPfisterer. Caching for each zoom level seems to make sense...
I also looked into mapbox/supercluster and its go-counterpart MadAppGang/gocluster which calculate cluster nodes efficiently. To say it with MadAppGang's words: 'The cluster use hierarchical greedy clustering approach. The same approach used by Dave Leaver with his fantastic Leaflet.markercluster plugin.'
The benefit of integrating such functionality right into tile38 would be
- no more external servers, for example one running mapbox/supercluster
- performance! data is being processed right where it sits
One solution that would work perfectly for my project could look like this...
- a tile38 command to generate a point cluster for a given key; example:
INTERSECTS key CLUSTER dest_key ZOOMLEVEL 1 18 BOUNDS ...
with <dest_key> being generated by tile38 using some scheme, e.g. <dest_key>_{zoomlevel} => dest_key_1, dest_key_2, ... dest_key_18
- my app adjusting marker layers to a specific dest_key depending on the zoom level of the map
@tidwall is this a feature you would consider integrating into tile38?
I would consider this, yes.
Cluster functionality would be very useful. Also, for feature counts too large for client-side viz, built-in density/heatmapping for point collections would be a distinguishing feature that aligns nicely with the real-time aspect of Tile38.
It's probably better (smarter?) to do it in an app server/middleware, but there is something about the ability to see aggregated activities on a map. In the past, I have found using indexed and clustered point systems like this work well enough for on-demand heat maps. Most modern web mapping libraries now work well with raw pixel data now, so Tile38 wouldn't need image file creation, just blast out the raw pixel data in the response.
INTERSECTS myXYZptcluster TILE X Y Z RAWDENSITYPIXELDATA
Start your Tile38 instance up in "heatmap mode", and everyone gets a strava-style, tiled heatmap.😉
I would love this! Any news on the topic?