Afternoon forum and thank you in advance for any input you have.
Xamarin Forms solution and looking to migrate from GoogleMaps SDK to ThinkGeo.
The move is to give the users a much more powerful mapping experience which I believe ThinkGeo certainly offers but there are some things that GoogleMaps SDK does very well and thats the subject of this question.
Using GoogleMaps when the user taps on a feature the feature tapped on is passed to your tapped event.
A very handy thing … to be given the feature tapped.
I can then display a popup with some summary info on the feature.
It appears ThinkGeo does not support this in such a simple and direct way. Please correct me if I am wrong.
Based on the HowDoISamples:
/Samples/UsingOverlays/UsingPopupsSample.xaml.cs to use Popups and
/Samples/UsingQueryTools/GetFeaturesWithinDistanceSample.xaml.cs to find what features are near to/within the tapped position …
Is this the correct/best/preferred way to find the feature under where the user tapped?
If so I have some questions to clarify how to do this best.
What I currently have is the following:
- I subscribe to the MapSingleTap event on the MapView.
- Using that PointShape I get from the event I use the FeatureLayer.QueryTools.GetFeaturesWithinDistanceOf method to obtain a list of features near to the PointShape (that is where the user tapped).
- Based on the potential list of Features returned I assume the first is the closest and I create and show a popup based on that feature.
Is this the best/preferred way to do this?
If it is then I have some further questions?
- The GetFeaturesWithinDistanceOf method returns a list of features. What is the order of that returned set? Doco does not provide that detail. Can I assume the first is the closest? How do I get the closest to the PointShape from that set?
- From a user experience and thinking of a fat fingered user … should I handle the fact the user is possibly tapping on the image/icon of the feature which is quite possibly offset to the actual location. Any ideas or recommendations here?
- What happens here if I have a ClusterPointStyle? Do I simply get all the features that make up the Cluster or do I get some form of Clustered representation of those features clustered? As in the features in the returned list somehow identify the cluster they are in?
I expect to have quite a few feature layers (possibly 5) as a logical grouping of my features (possibly have in the hundreds of features). I expect to have this many layers to assist with handling the volume of features from a style view and to allow users to hide based on the layer.
Using the GetFeaturesWithinDistanceOf which is a feature layer method I could
- Simply iterate over all my layers running the query and building a list of possible features OR
- Keep a single InMemory feature layer containing all the features yet this one is hidden from view and I query that.
What would be the more costly of the two? Iterate and open/close for each layer OR the overhead of a single hidden layer that duplicates the features?
I hope for and look forward to any help/suggestions you have to offer.
Cheers
Chris …