Select to view content in your preferred language

zoomToGeometry

1846
3
Jump to solution
05-12-2014 02:22 AM
fengli
by
Emerging Contributor
Hi,all.I have some question about
-(void)zoomToGeometry:(AGSGeometry*)geometry withPadding:(CGFloat)padding animated:(BOOL)animated this method.
When i have not  set    [self.mapview.locationDisplay startDataSource],the zoomToGeometry is working fine,can zoom to the point.
After i added locationDisplay startDataSource,zoomToGeometry can not zoom to the point, it's always zoom to someplace.
It's working fine on version 2.2 ,now i'm using 10.2, so, why ? Have someone can help me ?...
0 Kudos
1 Solution

Accepted Solutions
SuganyaBaskaran1
Esri Contributor
This seems to be an issue with the SDK. We'll work on fixing it, thanks for reporting.

As a workaround, assuming you are starting the datasource in mapViewDidLoad:, calling zoomToGeometry after that in a different method call (like in an IBAction) seems to work.

View solution in original post

0 Kudos
3 Replies
SuganyaBaskaran1
Esri Contributor
When you start data source, and if your auto pan mode is anything other than AGSLocationDisplayAutoPanModeOff, the map would zoom to your current location. If you want to zoom to a different area, turn off location display's auto pan mode.

[self.mapView.locationDisplay startDataSource];
self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeOff;


More information on auto pan modes here

Hope this helps! I encourage you to try our latest releases 10.2.3 or 10.2.2  to take advantage of all the new capabilties
0 Kudos
fengli
by
Emerging Contributor
When you start data source, and if your auto pan mode is anything other than AGSLocationDisplayAutoPanModeOff, the map would zoom to your current location. If you want to zoom to a different area, turn off location display's auto pan mode.

[self.mapView.locationDisplay startDataSource];
self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeOff;


More information on auto pan modes here

Hope this helps! I encourage you to try our latest releases 10.2.3 or 10.2.2  to take advantage of all the new capabilties


Thanks for your help,but when i set AGSLocationDisplayAutoPanModeOff,it's zoom to the current location,not zoom to the point,( the point will show parks or amenities),on 2.2,i can zoom to the point with "zoomToGeometry", now,i can not.i have set [self.OneMapView zoomToGeometry:point withPadding:10 animated:TRUE],  however, it not work.
0 Kudos
SuganyaBaskaran1
Esri Contributor
This seems to be an issue with the SDK. We'll work on fixing it, thanks for reporting.

As a workaround, assuming you are starting the datasource in mapViewDidLoad:, calling zoomToGeometry after that in a different method call (like in an IBAction) seems to work.
0 Kudos