문제

I have an external csv file providing data to my map using omnivore. I am trying to use L.mapbox.marker.icon styles to change the default "pin-drop" styling, but it continues to use the default styling (blue with white-dot center).

A portion of the code I'm using is below.

Is there something wrong with the way I'm trying to style this?

var points = omnivore.csv('datelist.csv', {
    icon: L.mapbox.marker.icon({
        'marker-symbol': 'airport',
        'marker-color': '59245f'
    })
}).on('ready', function() {
    map.fitBounds(points.getBounds());
    var markers = L.markerClusterGroup({
        showCoverageOnHover: false,
        maxClusterRadius: 50
    });
    markers.addLayer(points);
    map.addLayer(markers);
    points.eachLayer(eachLayer);
});
도움이 되었습니까?

해결책

The second option to omnivore.csv is options for the parser, not for the layer. You would move your style definition into the ready block and use .setIcon to change the marker icons.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top