Hi,
I created offline geocoding with composite address locator according to this sample Geocoding | ArcGIS for Developers . I just used "Single Line Input" in address.Add.
Everything works fine in terms of displaying the correct location with the graphic overlay.
But the map is not zooming to that location it's just kind of centring. How should I change the code to zoom to the found location?
Could someone help me out with it?
Thanks!
Solved! Go to Solution.
Hi Jana,
The way it created in the sample is to create an extent out of the results which mostly more than one location then zoom to that extent.
In your case I believe you have only one point as a result to zoom to, so here is the way to zoom and center a point, you can change the scale value as desired.
await MyMapView.SetViewAsync(_graphicsOverlay.Graphics[0].Geometry);
await MyMapView.ZoomToScaleAsync(560);
Thanks,
Asser
Hi Jana,
The way it created in the sample is to create an extent out of the results which mostly more than one location then zoom to that extent.
In your case I believe you have only one point as a result to zoom to, so here is the way to zoom and center a point, you can change the scale value as desired.
await MyMapView.SetViewAsync(_graphicsOverlay.Graphics[0].Geometry);
await MyMapView.ZoomToScaleAsync(560);
Thanks,
Asser
Thanks a lot!