{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6568","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6568/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6568/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6568/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/6568","id":180792165,"number":6568,"title":"Wrong attribution positioning after resizing MGLMapView via constraints","user":{"login":"u10int","id":7958,"avatar_url":"https://avatars.githubusercontent.com/u/7958?v=3","gravatar_id":"","url":"https://api.github.com/users/u10int","html_url":"https://github.com/u10int","followers_url":"https://api.github.com/users/u10int/followers","following_url":"https://api.github.com/users/u10int/following{/other_user}","gists_url":"https://api.github.com/users/u10int/gists{/gist_id}","starred_url":"https://api.github.com/users/u10int/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u10int/subscriptions","organizations_url":"https://api.github.com/users/u10int/orgs","repos_url":"https://api.github.com/users/u10int/repos","events_url":"https://api.github.com/users/u10int/events{/privacy}","received_events_url":"https://api.github.com/users/u10int/received_events","type":"User","site_admin":false},"labels":[{"id":77255735,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/bug","name":"bug","color":"0052cc","default":true},{"id":92400707,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"000000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-04T02:28:41Z","updated_at":"2016-11-16T16:38:18Z","closed_at":null,"body":"There seems to be an issue when resizing an MGLMapView via AutoLayout constraints during a custom view controller transition animation that breaks the layout of the attribution views that are normally at the bottom corners. My view controller transition consists of expanding the map view full screen from a smaller frame in the presenting profile/detail controller.\n\nDuring the transition, the MGLMapView instance from the detail/profile controller is added as a subview of the destination/target view controller after which the necessary AutoLayout constraints are setup and then animated from the starting frame to the destination (full screen) frame. It appears that perhaps changing the map view's parent in this process may be breaking the position of the logo and attribution views at the bottom of the map. \n\nWhen working with Mapbox support a few months ago on the issue, it was believed the cause was related to [this issue](https://github.com/mapbox/mapbox-gl-native/issues/3697). But the latest SDK versions still have the issue.\n\nHere's a screen capture of the issue:\n\n![mapbox-logo-position](https://cloud.githubusercontent.com/assets/7958/19060710/4d4ffa02-899f-11e6-8866-f10dd6741aca.gif)\n\nPlatform: iOS 8.0+\nMapbox SDK: 3.3.4\n\nHere's condensed version of the code that performs this presentation transition animation via the UIViewControllerAnimatedTransitioning protocol:\n\n``` swift\nlet toViewController = toViewControllerInContext(transitionContext)\nlet targetViewController = targetViewControllerForKey(UITransitionContextToViewControllerKey, inContext: transitionContext)\n\ntransitionContext.containerView().addSubview(toViewController!.view)\n\nif let mapController = targetViewController as? MapViewController, mapView = mapController.mapView {\n    mapController.view.layoutIfNeeded()\n\n    let originalMapSuperview = mapView.superview\n    let targetMapFrame = mapController.mapContainerView.convertRect(originalMapSuperview!.frame, fromView: originalMapSuperview!.superview!)\n    mapController.mapContainerView.addSubview(mapView)\n\n    var mapHeightConstraint: NSLayoutConstraint?\n    var mapTopConstraint: NSLayoutConstraint?\n\n    constrain(mapView) { view in\n        view.left == view.superview!.left\n        view.right == view.superview!.right\n        mapHeightConstraint = (view.height == CGRectGetHeight(targetMapFrame))\n        mapTopConstraint = (view.top == view.superview!.top + CGRectGetMinY(targetMapFrame))\n    }\n\n    mapHeightConstraint?.constant = CGRectGetHeight(mapController.mapContainerView.frame)\n    mapTopConstraint?.constant = 0\n    UIView.animateWithDuration(transitionDuration(transitionContext), delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in\n        mapController.view.layoutIfNeeded()\n        }, completion: { (finished) -> Void in\n            transitionContext.completeTransition(true)\n    })\n}\n```\n### Expected behavior\n\nThe map view's attribution views should remain pinned to the bottom corners of the map when animating its layout constraints.\n### Actual behavior\n\nThe map view's attribution views break their layout when animating the map view's layout constraints.\n"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/260998068","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/6568#issuecomment-260998068","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6568","id":260998068,"user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T16:38:18Z","updated_at":"2016-11-16T16:38:18Z","body":"#6776 fixes some issues with the map view's internal constraints, but some known problems remain: #6954.\r\n\r\nOne workaround for your issue may be to hide the compass, logo view, and attribution button during the animation and show them again afterwards."}}
{"actor":{"display_login":"1ec5"}}