防止在 mapbox-gl 中旋转地图上的图层旋转
Prevent a layer rotation on map rotate in mapbox-gl
有没有办法在地图旋转时禁用图层旋转?
我正在使用带有箭头图像图标的符号层,我不希望它们随地图旋转并保持固定。
您应该将“icon-rotation-alignment”设置为“地图”(默认为“自动”)。
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.
有没有办法在地图旋转时禁用图层旋转? 我正在使用带有箭头图像图标的符号层,我不希望它们随地图旋转并保持固定。
您应该将“icon-rotation-alignment”设置为“地图”(默认为“自动”)。
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.