Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent flatting of 3D Terrain Satellite map styles when pitching. #2240

Open
Gnative opened this issue Sep 21, 2024 · 6 comments
Open

Prevent flatting of 3D Terrain Satellite map styles when pitching. #2240

Gnative opened this issue Sep 21, 2024 · 6 comments

Comments

@Gnative
Copy link

Gnative commented Sep 21, 2024

I updated my Satellite map style and I am using the 3D Terrain layer to display this. Now when I pitch to 0 (or viewing directly downward) the map does the flatting animation thing where the 3D Terrain layer is flattened.. I didn't set the map to do this and would prefer it wouldn't do this as, to me, it looks a little buggy and i like the original 3D perspective from above. Is this a new feature and if so can we have a setting to keep it so that the 3D perspective is kept ?

Thank you

Strangely the vector maps still have this 3D perspective on 0 pitch, its only applied to the satellite map style as you can see in this video.

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-09-21.at.18.56.21.mov
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-09-21.at.18.59.49.mov
@Gnative Gnative changed the title Prevent flatting of 3D Terrain Satellite map styles. Prevent flatting of 3D Terrain Satellite map styles when pitching. Sep 21, 2024
@astojilj
Copy link
Contributor

Could you please check if your style has the root-level property "camera"->"camera-projection" set to "perspective"? Flattening is related to "orthographic" "camera-projection" behavior. Standard style uses "orthographic".

E.g. style's json should not have "orthographic" here but "perspective".

image

@Gnative
Copy link
Author

Gnative commented Sep 22, 2024

Hi @astojilj thanks for the reply.

No it looks like the root-level camera property is not set.. This is a fairly old base style that I have updated.
I am not able to see where you would set this with in the style either. Sorry if this is obvious, it is just not to me at the moment.

style.json

@astojilj
Copy link
Contributor

@Gnative

Your style now imports Standard Satellite style, and inherits the layers and settings from there, including camera-projection. The style.json you shared includes this:

"imports": [
    {
        "id": "basemap",
        "url": "mapbox://styles/mapbox/standard-satellite",
        "config": {"show3dObjects": false, "theme": "default"}
    }
],

So, you'd need to override this - add this e.g. just before "imports", the code should look like:

"camera": {
    "camera-projection": "orthographic"
},
"imports": [
    {
        "id": "basemap",
        "url": "mapbox://styles/mapbox/standard-satellite",
        "config": {"show3dObjects": false, "theme": "default"}
    }
],

@Gnative
Copy link
Author

Gnative commented Sep 22, 2024

OK thank you so much. I don't see where to do this in the Style Studio. I guess I need to do this at app level ?

@astojilj
Copy link
Contributor

Could you please try editing the style.json in a text editor (to add the aforementioned camera projection) and then importing the JSON file back into Studio?

@Gnative
Copy link
Author

Gnative commented Sep 22, 2024

@astojilj Yes this works.. the camera-projection: perspective property does as I expect now. I also checked with the orthographic value and this brought back the flattening effect.

It must be when I updated a layer in the original style that this base default properties were then applied.

Is there a way to apply this to my original style as the style ID is coded into my IOS and Android apps ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants