Skip to content

Commit e8e66f4

Browse files
committed
KML: Added onEachFeature support
1 parent 0969aaf commit e8e66f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

layer/vector/KML.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ L.KML = L.FeatureGroup.extend({
77
name_on_props : false,
88
name_prop : 'kml_name',
99
descr_on_props : false,
10-
descr_prop : 'kml_description'
10+
descr_prop : 'kml_description',
11+
onEachFeature: null
1112
},
1213

1314
initialize: function(kml, options) {
@@ -342,6 +343,9 @@ L.Util.extend(L.KML, {
342343
if(this.options.popup && ( name || descr ))
343344
layer.bindPopup('<h2>' + name + '</h2>' + descr);
344345

346+
if(typeof(this.options.onEachFeature) === 'function')
347+
this.options.onEachFeature(layer.feature, layer);
348+
345349
return layer;
346350
},
347351

0 commit comments

Comments
 (0)