Map Cluster Layer Heuristics Algorithm

I am implementing an Cluster Layer with heuristics algorithm  based on Google Maps JS API with reference to MarkerCluster.

It works like this:

1. Set a maximum zoom level Max

2. If map.getZoom() > Max, remove the cluster layer, and display the original point layer

3. If map.getZoom() <= Max, remove the original point layer

If init load on minimal zoom level, query all points out, and store on client side, later use this data to Filter cluster layer markers based on map.getBounds(), i.e. map extent

If map load on between minimal zoom level and Max, query data based on map.getBounds()

4. Filter function

a. get xmin, ymin, xmax, ymax from the map bounds.

b. filter points within the map bounds to redraw Cluster Layer

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s