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