This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Migrate MGLCustomStyleLayerAdditions to style layer API #7250
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1ec5
added
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
refactor
runtime styling
labels
Nov 30, 2016
@1ec5, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @incanus and @boundsj to be potential reviewers. |
1ec5
force-pushed
the
1ec5-opengl-layer
branch
2 times, most recently
from
December 6, 2016 02:31
0c1da0a
to
5685717
Compare
1ec5
force-pushed
the
1ec5-opengl-layer
branch
from
December 6, 2016 02:52
5685717
to
9b88c6e
Compare
jfirebaugh
approved these changes
Dec 6, 2016
friedbunny
approved these changes
Dec 6, 2016
Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS. Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl.
Reprised the demo removed from iosapp in #5091.
MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp. Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack.
Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
1ec5
force-pushed
the
1ec5-opengl-layer
branch
from
December 7, 2016 07:35
9b88c6e
to
50026f2
Compare
1ec5
added a commit
that referenced
this pull request
Dec 7, 2016
1ec5
commented
Dec 7, 2016
|
||
/** | ||
Forces the map view associated with this style to redraw the receiving layer, | ||
causing its drawing handler to be run. |
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.
causing its drawing handler to be run
This is a holdover from the former block-based API. I reworded this sentence in 1781302.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and compatible with macOS. Reprised the demo removed from iosapp in #5091 inside macosapp.
Before this can land:
A reminder: undocumented APIs like MGLOpenGLStyleLayer are unsupported and may change at any time without notice.
Fixes #5972.
/cc @friedbunny @boundsj @jfirebaugh