|
POST
|
Actually you can also use extent height and width to calculate zoom factor. var currentMapExtent = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry.Extent; var zoomFactor = Math.Min(currentMapExtent.Width/geometry.Extent.Width, currentMapExtent.Height/geometry.Extent.Height); await MyMapView.SetViewpointCenterAsync(geometry.Extent.GetCenter(), MyMapView.MapScale/zoomFactor);
... View more
11-23-2016
02:05 PM
|
0
|
1
|
1924
|
|
POST
|
I see you can use SketchEditor to draw the zoom box and use the resulting geometry's extent to zoom into its center. When you draw the shape, it would be mouse down and drag to desired size, when you let go you will get a polygon of rectangle shape. For example on a button click: var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false); // Boolean indicates it will complete when geometry is drawn and no need to go to edit mode. await MyMapView.SetViewpointCenterAsync(geometry.Extent.GetCenter(), MyMapView.MapScale/2); // or whatever zoom factor you choose.
... View more
11-23-2016
02:01 PM
|
0
|
2
|
1924
|
|
POST
|
You can enable/disable zoom (including zoom box) using MyMapView.InteractionOptions = new MapViewInteractionOptions() { IsZoomEnabled = false }. If you want to programmatically zoom to a location, you can use MyMapView.SetViewpointCenterAsync(center, scale).
... View more
11-23-2016
10:54 AM
|
0
|
4
|
1924
|
|
POST
|
Yup you are correct. Geometries are immutable and can only be modified through geometry builders. And yes, we still have RenderingMode property on GraphicsOverlay that lets you choose between Static | Dynamic. These are still true in the new version of the API. Also the return value when you await RequestShapeAsync/EditGeometryAsync (v10.2.x) or StartAsync(v100.0) is of type Geometry which you can assign to an ArcGISFeature or Graphic. What kind of layer/overlay are you working with? Are you trying to update multiple graphics at once? I'm not sure how Editor can help with this since it works with only one geometry at a time and have no knowledge of other geometries that might share the same vertex. But perhaps some GeometryEngine methods can help? GeometryEngine.Relate, GeometryEngine.NearestCoordinate, GeometryEngine.NearestVertex? I'm curious to hear your solution for v10.2.x. Thanks. Jennifer
... View more
11-23-2016
10:46 AM
|
0
|
1
|
2844
|
|
POST
|
If you want to constrain map at a given extent, you can subscribe to ViewpointChanged and check whether the current viewpoint is still within the maximum extent you want to set it to. var extent = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry)?.TargetGeometry?.Extent; //current extent You can use GeometryEngine.Equals(extent, _lastCheckedExtent) and GeometryEngine.Within(extent, MaximumExtent) to ignore ones that you've already checked or fall within set maximum. Otherwise, MyMapView.SetViewpoint(new Viewpoint(MaximumExtent)) to set viewpoint to desired extent.
... View more
11-23-2016
08:48 AM
|
1
|
4
|
3857
|
|
POST
|
That is good to hear. Thanks for sharing your feedback. Please continue to share any tips/comments to this forum.
... View more
11-23-2016
08:06 AM
|
0
|
0
|
573
|
|
POST
|
Hi Fredy, Are you using v10.2.x? Editor.EditGeometryAsync was replaced by SketchEditor.StartAsync in v100.0. I'm not sure I understand what you mean by geometry is locked. You can update graphic.Geometry by setting it to polygonBuilder.ToGeometry() after you've made edits in the builder. Also, RenderingMode of Static | Dynamic is a property on GraphicsOverlay. I don't think you'll get this information from the graphic. Do you mind sharing some code-snippet? It's interesting use case and I'm wondering if there's anything in the API that can help with this. Thanks. Jennifer
... View more
11-22-2016
03:56 PM
|
0
|
3
|
2844
|
|
POST
|
SketchEditor.Geometry has the current state of geometry. When GeometryUpdated event is raised, its event args also contain the OldGeometry. I think this property and event might be of interest when using a geometry builder along side SketchEditor to keep them in sync.
... View more
11-22-2016
02:52 PM
|
0
|
0
|
2297
|
|
POST
|
Yes, you can use Polyline/Polygon builder with SketchEditor. If selecting vertex by tap to specify where AddCommand will insert new vertex is not enough, you can use polygonBuilder.Parts[0].SetPoint(index, MapPoint) for example and then update geometry using SketchEditor.ReplaceGeometry(polygonBuilder.ToGeometry()) so that edit tools (vertex, mid-vertex, selected vertex) are re-drawn with the new geometry. You can either turn on/off SketchEditor.IsEnabled so you can also interactively add/insert/move/delete vertex or keep using Add/DeleteCommand to programmatically update geometry, these commands act on selected vertex.
... View more
11-22-2016
02:49 PM
|
0
|
1
|
2297
|
|
POST
|
Do you mean you also need to programmatically update selected vertex? Currently, you will only be able to update selected vertex by tapping onto a vertex with SketchEditor.Enabled=True. The next AddCommand will add vertex after this selected vertex. You also might want to look at Polyline/PolygonBuilder to update your geometry. It has AddPoint, InsertPoint, SetPoint, RemovePoint, etc that might better suit your need. This gives you more control over which index you want to insert the point. You can then use SketchEditor.ReplaceGeometry(geometry) with geometry from builder if you need this geometry change to be added onto the undo stack. Will that work for you?
... View more
11-22-2016
01:45 PM
|
0
|
0
|
2297
|
|
POST
|
The SketchEditor currently works with one geometry at a time. If by 'shared vertex' you mean same start/end point in a polygon geometry where updating one, updates the other - this is the current behavior. But it sounds like you are working with multiple polygon geometries where some vertices may be shared and an update vertex in one polygon need to also update vertices in other polygons if shared, is this correct? If yes, I think you can use PolygonBuilder for each of your polygon geometries. On every part, Points will get you the unique vertices, while GetPoint(index) and SetPoint(index, newLocation) will give you the current location and update the vertex from specified position. You can then set feature or graphic Geometry with polygonBuilder.ToGeometry() to convert back to polygon.
... View more
11-22-2016
01:34 PM
|
0
|
5
|
2844
|
|
POST
|
Hi Stefan, Thanks for the clarification. You should be able to insert MapPoint from another source (without interaction with map) by calling AddCommand. Either these snippet will insert after selected vertex. If you want to disable SketchEditor from responding to map interaction, mark SketchEditor.IsEnabled=False so no tap event will add vertex but instead programmatically insert after selected vertex. Last vertex added in Polyline/Polygon becomes the new selected vertex, but you can tap to select a vertex to insert after that position. if(MyMapView.SketchEditor.AddCommand.CanExecute(MapPointSource)) MyMapView.SketchEditor.AddCommand.Execute(MapPointSource); or <Button Content="Add" Command="{Binding AddCommand}" CommandParameter="{Binding ElementName=Coordinates, Path=SelectedItem}" DataContext="Binding ElementName=MyMapView, Path=SketchEditor}"/> Thanks. Jennifer
... View more
11-22-2016
12:52 PM
|
0
|
0
|
2297
|
|
POST
|
In 10.2.x, Editor was not sealed because you can override OnGenerateSymbol. In 100.0.0, SketchEditor has SketchStyle which you can use to update Symbology. Do you have a specific use case that is currently not addressed? Thanks. Jennifer
... View more
11-22-2016
12:02 PM
|
0
|
0
|
2297
|
|
POST
|
I think this guide doc might help: Geoprocessing task—ArcGIS API for Silverlight | ArcGIS for Developers
... View more
07-14-2015
01:20 PM
|
0
|
0
|
2253
|
|
POST
|
Yes, you can use PrintParameters.Format to specify specify the file format. Your choices are available after making GetServiceInfo call: ArcGIS API for Silverlight API Reference| ArcGIS for Developers . PrintServiceInfo.Formats should give you the list of supported file format. SDK sample: ArcGIS API for Silverlight - Interactive Samples | ArcGIS for Developers The PrintResult.Url gives you link to the file. You have several options to download data and save, you can look at any of these samples: HttpClient: Downloading to a Local File in C# for Visual Studio 2010 WebClient.DownloadFile Method (String, String) (System.Net) How to save file locally after downloading it with webclient? silverlight - download file from absolute uri to stream to SaveFileDialog - Stack Overflow
... View more
05-06-2015
10:02 AM
|
2
|
0
|
664
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2026
09:38 AM
|