you would draw a box around a number of points and those points would then show up in the selected points datagrid. Then when you select an item in the data grid it would zoom to that point. So every time you click an item in the grid it zooms to a location on the map.
private void QueryDetailsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { foreach (Graphic g in e.AddedItems) { g.Select(); MyMap.ZoomTo(g.Geometry); } foreach (Graphic g in e.RemovedItems) g.UnSelect(); }
private void QueryDetailsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { foreach (Graphic g in e.AddedItems) g.Select(); foreach (Graphic g in e.RemovedItems) g.UnSelect(); }
private void QueryDetailsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { //This would work with multiple points being selected ESRI.ArcGIS.Client.Geometry.PointCollection points = new ESRI.ArcGIS.Client.Geometry.PointCollection(); foreach ( Graphic g in e.AddedItems ) { MapPoint mapPoint = g.Geometry as MapPoint; if (mapPoint != null ) { points.Add(mapPoint); } } MultiPoint multiPoint = new MultiPoint(points); MyMap.ZoomTo(multiPoint.Extent); //If you user was only allowed to select a single point it would be something like this Graphic g = e.AddedItems[0] as Graphic; MapPoint mapPoint = g.Geometry as MapPoint; if (mapPoint != null ) { MyMap.ZoomToResolution(MyMap.Resolution / MyMap.ZoomFactor, mapPoint); //As shown Above } foreach (Graphic g in e.RemovedItems) g.UnSelect(); }
MyMap.ZoomToResolution(MyMap.Resolution / MyMap.ZoomFactor, mapPoint);
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.