You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, with the introduction of #2294, we are now allowed to use the projection prop to set the projection used by the SDK.
However, I just realized that projection is part of the style spec. This means that we have to decide what has a higher priority - the projection prop or the style property. If I set globe inside my app and the style specifies projection: "mercator", what result should I expect?
Currently, as I've just realized, the behavior isn't even completely uniform between platforms. Both IOS and Android will initially force the projection set inside the projection prop, but switching styles is another story.
Current situation
On Android, we force the projection from the prop value every time a new style is loaded (reference). Since the projection defaults to mercator, any projection set in the file will be overridden on this platform.
The same cannot be said for IOS, where the projection is only set on prop changes and on initial load (reference). The state is not persisted, and if a new style with a different projection is loaded, it will change.
Opinion
I think that the prop should have a higher priority than the style property. However, we should probably make sure that - as long as no projection prop is set - we use fallback values in this order:
projection prop
projection style property
SDK default (mercator)
Any thoughs? Sorry for not bringing this up before the merge - I just realized this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Recently, with the introduction of #2294, we are now allowed to use the
projection
prop to set the projection used by the SDK.However, I just realized that
projection
is part of the style spec. This means that we have to decide what has a higher priority - theprojection
prop or the style property. If I setglobe
inside my app and the style specifiesprojection: "mercator"
, what result should I expect?Currently, as I've just realized, the behavior isn't even completely uniform between platforms. Both IOS and Android will initially force the projection set inside the
projection
prop, but switching styles is another story.Current situation
On Android, we force the projection from the prop value every time a new style is loaded (reference). Since the projection defaults to
mercator
, any projection set in the file will be overridden on this platform.The same cannot be said for IOS, where the projection is only set on prop changes and on initial load (reference). The state is not persisted, and if a new style with a different
projection
is loaded, it will change.Opinion
I think that the prop should have a higher priority than the style property. However, we should probably make sure that - as long as no
projection
prop is set - we use fallback values in this order:projection
propprojection
style propertyAny thoughs? Sorry for not bringing this up before the merge - I just realized this.
Beta Was this translation helpful? Give feedback.
All reactions