This section of code adds markers to my map (it works), how can I change the marker to a different icon when dealing with geojson?

var cycleracks = $.getJSON('cycle-racks.geojson', function (geojson) {
  L.geoJson(geojson, {
    onEachFeature: function (feature, layer) {

1 Answer 1


Take a look at this tutorial: http://leafletjs.com/examples/custom-icons.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.