Skip to content

Commit

Permalink
KML: Added onEachFeature support
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuccioni committed Jul 20, 2015
1 parent 0969aaf commit e8e66f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layer/vector/KML.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ L.KML = L.FeatureGroup.extend({
name_on_props : false,
name_prop : 'kml_name',
descr_on_props : false,
descr_prop : 'kml_description'
descr_prop : 'kml_description',
onEachFeature: null
},

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

if(typeof(this.options.onEachFeature) === 'function')
this.options.onEachFeature(layer.feature, layer);

return layer;
},

Expand Down

0 comments on commit e8e66f4

Please sign in to comment.