Add support for property "style" to geoJson. CSS styles can be used to style geoJson features.

This commit is contained in:
Marcus Winkler
2014-01-06 22:57:20 +01:00
parent 3162d6f529
commit a172b288da

View File

@ -44,7 +44,11 @@ var FileLoader = L.Class.extend({
if (typeof content == 'string') { if (typeof content == 'string') {
content = JSON.parse(content); content = JSON.parse(content);
} }
return L.geoJson(content, this.options.layerOptions).addTo(this._map); return L.geoJson(content, {
style: function (feature) {
return feature.properties && feature.properties.style;
}
}).addTo(this._map);
}, },
_convertToGeoJSON: function (content, format) { _convertToGeoJSON: function (content, format) {