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

Cannot set zoom immediately after setting center coordinate #1181

Closed

Description

@1ec5

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.)

Activity

  1. added
    iOS
    on Apr 2, 2015
  2. incanus commented on Apr 2, 2015

    @incanus
    Contributor

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

  3. friedbunny commented on Apr 2, 2015

    @friedbunny
    Contributor

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

  4. 1ec5 commented on Apr 2, 2015

    @1ec5
    ContributorAuthor

    Nice catch, @friedbunny! Fixed.

  5. added a commit that references this issue on Apr 3, 2015
    0a736c3
  6. added a commit that references this issue on Apr 3, 2015
    999ebb3
  7. added a commit that references this issue on Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugiOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions