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.
Why aren't mapbox markers not styling properly with external data (CSV) file
-
15-07-2023 - |
Question
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);
});
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow