Add support for property "style" to geoJson. CSS styles can be used to style geoJson features.
This commit is contained in:
6
external/leaflet.filelayer.js
vendored
6
external/leaflet.filelayer.js
vendored
@ -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) {
|
||||||
|
Reference in New Issue
Block a user