-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expose name and default position of current style #6127
Conversation
I punted on jumping to the style’s default viewport on initialization, because the style may take an indeterminate amount of time to load. Would it be desirable to jump to that position as soon as the style finishes loading? We’d need to avoid clobbering any developer- or user-initiated viewport modifications. The same complications would arise if we were to respect the style’s default viewport when switching styles. |
That's the behavior of GL JS. My preference would be to implement this behavior in core. |
Split out #6129 to consider jumping to the default viewport on initialization. |
camera.altitude = MGLAltitudeForZoomLevel(0, 0, 0, self.frame.size); | ||
self.camera = camera; | ||
CGFloat pitch = _mbglMap->getDefaultPitch(); | ||
CLLocationDirection heading = mbgl::util::wrap(_mbglMap->getDefaultBearing(), 0., 360.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like studio wraps bearings. Do we do this since we don't know where the style will actually come from? (just curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we can’t assume the style was authored in Studio. Alternatively, we could establish a convention that mbgl::Map
wraps the return values of getDefeaultBearing()
and getBearing()
, but we can tackle that separately from this PR.
👍 |
This is a followup to #6002 that exposes the current style’s name and makes
-[MGLMapView resetPosition]
reset to the style’s default viewport rather than the SDK default./cc @friedbunny