Repository navigation
[not ready] Better handling for undefined icon|text-rotation-alignment - #3203
Merged
Merged
Conversation
3 tasks done
Contributor
Author
|
@lbud I think e9b7cfb should unblock mapbox/mapbox-gl-test-suite#144 |
jfirebaugh
suggested changes
Sep 19, 2016
| @@ -12,19 +12,28 @@ module.exports = SymbolStyleLayer; | |||
| SymbolStyleLayer.prototype = util.inherit(StyleLayer, { | |||
|
|
|||
| getLayoutValue: function(name, globalProperties, featureProperties) { | |||
Contributor
There was a problem hiding this comment.
Here's a shorter and clearer way to write this:
getLayoutValue: function(name, globalProperties, featureProperties) {
var value = StyleLayer.prototype.getLayoutValue.apply(this, arguments);
if (value !== 'auto') {
return value;
}
switch (name) {
case 'text-rotation-alignment':
case 'icon-rotation-alignment':
return this.getLayoutValue('symbol-placement', globalProperties, featureProperties) === 'line' ? 'map' : 'viewport';
case 'text-pitch-alignment':
return this.getLayoutValue('text-rotation-alignment', globalProperties, featureProperties);
default:
return value;
}
}
jfirebaugh
force-pushed
the
boundsj-symbol-complex-default
branch
from
September 20, 2016 19:03
4231f85 to
01f8d0d
Compare
jfirebaugh
approved these changes
Sep 21, 2016
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This updates the symbol style layer so that it uses the correct values (viewport or map) when the auto value is set explicitly or by default for the properties that support it.
text-pitch-alignmentcontinues to parrot text-rotation-alignment but now also does so if its value is explicitly set to auto.Companion to mapbox/mapbox-gl-style-spec#493, mapbox/mapbox-gl-native#6253, and mapbox/mapbox-gl-test-suite#144.
Part of the federation of PRs to address mapbox/mapbox-gl-native#5683
Launch Checklist
cc @jfirebaugh @lbud