Mapbox Gl JS-绘制汽车标记 [英] Mapbox gl js - draw a car marker

查看:330
本文介绍了Mapbox Gl JS-绘制汽车标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据其位置绘制汽车标记.但是,与所有官方示例(例如)不同,我希望标记的大小取决于缩放级别.而且,我希望它也具有方向性-我需要根据汽车的方向旋转它. Mapbox GL JS是否有可能,以及如何做到?

I need to draw a car marker based on it's position. But, unlike all official examples, like this, I want size of my marker to be dependent on zoom level. And, I want it to have heading as well - I need to rotate it based on the car's heading. Is it possible with Mapbox GL JS, and how to do it?

推荐答案

符号图层 https://www.mapbox.com/mapbox-gl-js/style-spec#layers-symbol 最适合此操作,请参见以下示例 https://www.mapbox.com/mapbox-gl-js/example/rotating-controllable -marker/

The Symbol layer https://www.mapbox.com/mapbox-gl-js/style-spec#layers-symbol is best suited for this, see this example https://www.mapbox.com/mapbox-gl-js/example/rotating-controllable-marker/

这篇关于Mapbox Gl JS-绘制汽车标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆