How can i zoomin to a map , by drawing a rectangle on the map and zoom that particular area?? Please Help Michael BranscombAntti KajanusMorten Nielsen@
Thanks in advance,
Vijit
By default, you can hold "Shift" key and then draw a rectangle on the MapView to use similar navigation. If you want to zoom out, you can do "Shift+ Ctrl" combo instead.
If you want to implement your own, then you can do something like this:
private async void Button_Click(object sender, RoutedEventArgs e)
{
try
{
// use the MapView's Editor to request geometry (Envelope) from the user and await the result
var newExtent = await myMapView.SketchEditor.StartAsync(Esri.ArcGISRuntime.UI.SketchCreationMode.Rectangle, false);
// set the map view extent with the Envelope
await myMapView.SetViewpointGeometryAsync(newExtent);
}
catch (TaskCanceledException tce)
{
// sketching cancelled
}
catch (Exception ex)
{
}
}
Thankyou Sir.