Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Cannot set zoom immediately after setting center coordinate #1181

Closed
1ec5 opened this issue Apr 2, 2015 · 3 comments
Closed

Cannot set zoom immediately after setting center coordinate #1181

1ec5 opened this issue Apr 2, 2015 · 3 comments
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Apr 2, 2015

The following code takes you to the lovely town of Emerald, Victoria, Australia:

self.mapView.zoomLevel = 15;
[self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(-23.526029999999999, 148.16224)];

vic

But reverse the two calls and you wind up off the coast of Papua New Guinea:

[self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(-23.526029999999999, 148.16224)];
self.mapView.zoomLevel = 15;

png

-[MGLMapView setCenterCoordinate:zoomLevel:animated:] works fine of course, but I need something less atomic to make #929 work well. Otherwise you have to ensure that zoomLevel appears before latitude or longitude in the storyboard XML. (Interface Builder doesn’t let you rearrange user-defined runtime attributes using the inspector.)

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS labels Apr 2, 2015
@incanus
Copy link
Contributor

incanus commented Apr 2, 2015

Yep, we had this problem in the iOS SDK and I've been seeing it in testing.

@friedbunny
Copy link
Contributor

(Your description is clear, but the code example isn't actually reversed.)

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 2, 2015

Nice catch, @friedbunny! Fixed.

@incanus incanus closed this as completed in 0a736c3 Apr 3, 2015
incanus added a commit that referenced this issue Apr 3, 2015
fixes #1181: fix lat/lng & zoom ordering problems
1ec5 added a commit that referenced this issue Apr 3, 2015
Declared these IB-specific inspectables in a separate category that developers are not expected to import. Currently these inspectables are order-dependent due to #1181.

Ref #929
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants