Quantcast
Channel: Question and Answer » leaflet
Viewing all articles
Browse latest Browse all 198

Leaflet: how to change default style on a point GeoJSON Layer?

$
0
0

I need to change style on a point GeoJSON layer in a Leaflet map.

I’m using the following code:

function onEachFeature(feature, layer) {
                      if (feature.properties && feature.properties.popupContent) {
                         layer.bindPopup(feature.properties.popupContent);
                      }
                     }

var myStyle = {
 "color": "#ff7800",
 "weight": 5,
 "opacity": 0.65
};

myGeoJSONLayer = L.geoJson(myGeoJSON, {
                      style: myStyle,
                      onEachFeature: onEachFeature,
             });

myGeoJSONLayer.addTo(map);                         

All is working but there is always the standard default blue marker on my map.

Any suggestions are appreciated.


Viewing all articles
Browse latest Browse all 198