none
ClusterLayer: Set polygons as grid square RRS feed

  • Question

  • Hi Ricky, 

    Would it be possible to set in the ClusterLayerOptions a property that overrides the square grid system in favor of a system based on polygons ?

    Example: i want to display 1000 stores as pushpins in Paris. I already have the polygons of the areas of Paris. It would be preferable for a user to see the cluster pushpins based on the areas.


    Tuesday, October 25, 2016 4:00 PM

Answers

  • This won't be added to the Clustering Layer class/options. It's not that common of a scenario and would require completely different logic than what the clustering layer class uses. It would be best to create a custom solution for this. Or better yet, if the data doesn't change that often, pre-calculate this information and only load in the data that is needed when needed. That would be much better than clustering. If your data is stored in a spatial database such as SQL Azure, you can use the built in spatial functions to cluster your data point data to polygons by using the intersects function. https://technet.microsoft.com/en-us/library/bb933899(v=sql.110).aspx

    If you really want to do this calculation on the fly in the browser you can use the spatial math module in Bing Maps V8 and it's intersects function to group pushpins with their relative polygons, however this will likely be slow as it is an intensive calculation.


    [Blog] [twitter] [LinkedIn]

    Tuesday, October 25, 2016 5:25 PM