Server side clustering

28 views
Skip to first unread message

Giorgi

unread,
Mar 15, 2017, 2:37:32 PM3/15/17
to Leaflet
Hey guys,

I need to implement server side clustering. Do you have some ideas how to do this? Or links to tutorials?
e.g. what I want say:

1. user is on some zoom level
2. based on this say server sends only two points - but these points are really clusters, so they each have counts
3. Now, on map I show these two points, with counts as marker icons (e.g. one marker says 20012 other says 342
4. Now if user zooms further, server will send another cluster of icons, and so on.

I hope you have an idea what I want. Any hints how to implement this? Or if you know tutorial, or plugin for this?

k_man_au

unread,
Mar 20, 2017, 5:51:38 PM3/20/17
to Leaflet
Would be interested in this, some thoughts below, 

On Thursday, March 16, 2017 at 5:37:32 AM UTC+11, Giorgi wrote:
Hey guys,

I need to implement server side clustering. Do you have some ideas how to do this? Or links to tutorials?
e.g. what I want say:

 you'll need to use an ajax call to load a GeoJSON data set .
 

1. user is on some zoom level

 Zoom level can be sent to the server with map.getZoom()
 
2. based on this say server sends only two points - but these points are really clusters, so they each have counts

This will be the tricky part, perhaps the code from markercluster can be ported
 
3. Now, on map I show these two points, with counts as marker icons (e.g. one marker says 20012 other says 342

Return the number of rows in the result set as an attribute in the JSON.
 
4. Now if user zooms further, server will send another cluster of icons, and so on.

Attach ajax call to the zoomlevelschange or zoomend event

Giorgi

unread,
Mar 25, 2017, 6:16:46 AM3/25/17
to Leaflet
thanks for your response. 
Reply all
Reply to author
Forward
0 new messages