如何使用for循环添加多个Mapbox标记

时间:2020-05-15 09:12:53

标签: javascript jquery arrays object mapbox

我正在使用mapbox animation marker

map.on('load', function() {
        map.addImage('pulsing-dot', pulsingDot, { pixelRatio: 2 });

    map.addSource('points', {
        'type': 'geojson',
        'data': {
            'type': 'FeatureCollection',
            'features': [
                {
                    'type': 'Feature',
                    'geometry': {
                        'type': 'Point',
                        'coordinates': [0, 0]
                    }
                }
            ]
        }
    });
    map.addLayer({
        'id': 'points',
        'type': 'symbol',
        'source': 'points',
        'layout': {
            'icon-image': 'pulsing-dot'
        }
    });
});

我想使用for循环按国家(地区)的纬度和经度添加多个标记。 Full source code

0 个答案:

没有答案
相关问题