-
-
Notifications
You must be signed in to change notification settings - Fork 977
Open
Labels
PR is more than welcomedExtra attention is neededExtra attention is neededbugSomething isn't workingSomething isn't working
Description
maplibre-gl-js version: 5.14.0 (latest)
Steps to Trigger Behavior
- In the style document if I do not specify the
projection, then the defaultprojectionismercatoras per the documentation. - In this case
map.getProjection()returnsundefined, which is understandable because theprojectionis not defined after all. - I explicitly set the
projectiontomercatorusingmap.setProjection() map.getProjection()still returnsundefined- this is unexpected.- Setting the projection to
globeto an undefined projection has the correct behaviour though.
Link to Demonstration
Expected Behavior
- After
map.setProjection({type: "mercator"})to an undefined style,map.getProjection()should returnmercator. - If
map.getProjection()is allowed to returnundefined, then the wording in the style documentation
Optional projectionDefinition. Defaults to "mercator".
should be improved to
Optional projectionDefinition. If not specified the map will be rendered as if "mercator" projection is used.
Actual Behavior
See Steps to Trigger Behavior
Use-case
I had this problem because I wanted to define the projection based on zoom values. I also needed to dynamically set the projection at initialzation based on zoom level, hence there was no default projection defined.
Metadata
Metadata
Assignees
Labels
PR is more than welcomedExtra attention is neededExtra attention is neededbugSomething isn't workingSomething isn't working