Display selectable Points at runtime

147
3
05-05-2021 02:34 PM
JacobPorter
New Contributor

I am trying to get a Map that has selectable points that will navigate to a details page. These points are coming from a local database that can change often. The map will need to set these points at runtime. The map will also need to be offline. Any tips on what tools to use would be great. I have currently tried a map with graphics. 

0 Kudos
3 Replies
MikeBrownNCDOT
New Contributor II

ArcGIS might be overkill for what you are looking to do. It is more about working with points stored in a service or feature layer. You can manually add all the points at runtime as a graphics overlay, as you mentioned. This would be the same method used by pretty much any mapping library you'll use (I've used GMaps.NET for this before). 

I'm sure you are aware, but here is the tutorial for the graphics overlay: Add a point, line, and polygon | ArcGIS Runtime API for .NET | ArcGIS for Developers

You would just hand your MapViewModel a list of the points & metadata from your database at runtime and loop through, adding one point at a time. Keep in mind this isn't live data - you would refresh this cache through another bulk query & data processing.

JacobPorter
New Contributor

Thanks for the help. I am currently just doing it with Graphics. A couple of other parts of my app are it is a Xamarin Forms app and it needs to go offline and still have the maps with pins and also the ability to navigate. Not sure if Gmaps.net supports Xamarin, but will also give it a try. 

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

The approach with the best support for this scenario would be using a feature service and one of the offline map workflows (as mentioned in an earlier reply): https://developers.arcgis.com/net/offline-maps-scenes-and-data/.

A GraphicsOverlay might fit your needs, but you could also take a look at FeatureCollections which provide ToJson/FromJson methods for saving (they also support saving as portal items): https://developers.arcgis.com/net/wpf/api-reference/html/T_Esri_ArcGISRuntime_Data_FeatureCollection....

For a sample see https://developers.arcgis.com/net/wpf/sample-code/feature-collection-layer/.

0 Kudos