more detailed example

This commit is contained in:
Mourner 2011-06-10 15:58:13 +03:00
parent 1b83a2d55f
commit cd4ea5312d

View File

@ -30,7 +30,16 @@
var geojson = new L.GeoJSON();
/*
points are rendered as markers by default, but you can change this:
var geojson = new L.GeoJSON(null, {
pointToLayer: function(latlng) { return new L.CircleMarker(latlng, 5) }
});
*/
geojson.on('featureparse', function(e) {
// you can style features depending on their properties, etc.
if (e.layer instanceof L.Path) {
e.layer.setStyle({color: e.properties.color});
}