有没有办法为mapbox GL标记添加透视图?

时间:2017-02-03 05:38:59

标签: mapbox mapbox-gl mapbox-gl-js mapbox-marker

我有一个地图点击功能,可以在地面上绘制一个波纹(GIF动画)。因为可以倾斜相机,所以涟漪效应只能从上到下的视角看起来正确。 有没有办法向标记添加透视元素,可以根据当前地图倾斜更新或设置?

这是我的地面代码。

map.on('click', function (e) {

    groundHit = document.createElement('div');
    groundHit.classList.add('groundHit');
    groundHit.style.backgroundImage = 'url(img/ripple.gif)';
    groundHit.style.width = '40px';
    groundHit.style.height = '40px';
    groundHit.style.perspective = '100px';

    var newGroundHit = new mapboxgl.Marker(groundHit, {
            offset: [-20, -20]
        })
        .setLngLat(e.lngLat)
        .addTo(map);

        setInterval(function() {
            newGroundHit.remove();
        }, 350);

});

1 个答案:

答案 0 :(得分:1)

我们目前不支持此功能。抱歉!

相关问题