Hello ThinkGeo,
I am seeking some help with my migration work.
I am migrating a fairly large XF app that had a XF Google Maps implementation.
In migrating from XF to MAUI I am also moving from the Google Maps implementation over to ThinkGeo.
Our use of the map is quite intense. Generally the users focus will not be wider than a City or Town. They will want to focus down to the street level and often multiple points around the City. That means lots of zooming in an out to allow them to move around the City. At those points we will have many hundred features. A typical focus point maybe lets say a housing block or street level. Looking over 20+ dwellings and 100+ features in that area.
Of those features there will be 6+ different types and we would use a PointStyle or the like to give each feature a different style shape and or color.
As you can imagine at some zoom levels you will be presented by a blanket of features and unable to see the map detail underneath them. Yet once zoomed in to a point you will want to see every individual feature.
Clustering is the answer.
Your clustering looks like it comes close to what we need and I have many questions below around your clustering implementation but we did develop our own clustering on the XF Google Maps implementation and I do have some questions around how to migrate that over.
I hope you can help and I hope that I have provided an outline on how we use a map.
Questions around our clustering solution
We implemented our own clustering as the google grid system just did not work the way the users expected it. It just did not make sense to them. We clustered based on a Haversine distance algorithm. NOTE that I have very much a beginners knowledge in this area.
One important element here is obtaining the maps current area so we can calculate the Haversine distance. The Google Maps implementation had properties that gave us the Long and Lat of the "Near Right’ and “Far Right” of the Map “region” currently in view. This does not appear to exist with ThinkGeo or I cannot find a way to obtain those values. Can you help with this?
Questions about your clustering implementation
You cluster at the Layer level. It’s a grid and I think this may work for us.
It appears that your cluster will be a “Gravity Well” in nature of where the Cluster is placed. As in based on the features that are in the cluster the final position of the cluster is calculated.
Is that correct?
I create a clusterstyle and add it to the zoomlevel set of the layer. Pretty much like your sample.
What I would like to do is have one pointstyle for the features not clustered and of course the clusterstyle for the clustered features.
I tried that by applying just that to the zoomlevel set as such
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(pointStyle);
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(clusterPointStyle);
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
This did not work the way I expected. Lets say I have 6 features and based on my clustering settings 3 will be clustered and 3 will not. What I expected was to have on the map was 3 in the pointStyle and 3 in the clusterPointStyle.
What I got was 6 in the pointStyle and 3 in the clusterPointStyle. The clustered features are not removed or hidden from the map display. How can I achieve the desired output of 3 points and 3 clustered?
Is there a way I can tell if a feature has been clustered?
The scenario I actually need is to have my many features that will have one of the 6+ styles applied to them (based on an attribute) but for the features that will be clustered based on my settings to have a different style and not be displayed as individual featuers.
It doesn’t seem that I can achieve that looking at your samples. With clustering all the features on the layer must have the same style with the exception of a number based from the feature count attribute.
Can you help here and clear this up?
As you can see my use of the map is fairly complex and I hope I have explained it above or maybe I just made it harder to understand?
Happy to provide and discuss further.
Regards
Chris …