Obtice
Obtice

Reputation: 1269

Prevent a layer rotation on map rotate in mapbox-gl

Is there anyway to disable layer rotation on map ratation ? I am using a symbol layer with arrow image icon and I don't want them ro ratate with map and stay fixed.

Upvotes: 1

Views: 1468

Answers (1)

Anatolii Suhanov
Anatolii Suhanov

Reputation: 2702

You should set "icon-rotation-alignment" to "map" (it's "auto" by default).

https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-rotation-alignment:

"map": When symbol-placement is set to point, aligns icons east-west. When symbol-placement is set to line or line-center, aligns icon x-axes with the line.

Upvotes: 5

Related Questions