Keep custom callbacks.

This commit is contained in:
David Molineus
2016-11-14 14:32:44 +01:00
parent da3b7ba994
commit 4c1df8eaaf
2 changed files with 8 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -27,10 +27,14 @@ L.OverPassLayer = L.FeatureGroup.extend({
* @param options
*/
initialize: function (options) {
L.Util.setOptions(this, options);
if (!options.pointToLayer) {
options.pointToLayer = this.pointToLayer;
}
if (!options.onEachFeature) {
options.onEachFeature = this.onEachFeature;
}
this.options.pointToLayer = this.pointToLayer;
this.options.onEachFeature = this.onEachFeature;
L.Util.setOptions(this, options);
this.options.dynamicLoad = this.options.query.match(/BBOX/g) ? true : false;
this._layer = L.geoJson();