Skip to content

Commit

Permalink
Merge pull request #29 from meihuisu/master
Browse files Browse the repository at this point in the history
allow parse to be called directly
  • Loading branch information
Raruto authored Nov 18, 2022
2 parents cb7f606 + bed500b commit 30dd04a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/KMZLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ export const KMZLayer = L.KMZLayer = L.FeatureGroup.extend({

load: function(kmzUrl) {
L.KMZLayer._jsPromise = _.lazyLoader(this._requiredJSModules(), L.KMZLayer._jsPromise)
.then(() => this._load(kmzUrl));
.then(() => _.loadFile(kmzUrl))
.then((data) => this.parse(data, { name: _.getFileName(kmzUrl), icons: {} }));
},

_load: function(url) {
return _.loadFile(url).then((data) => this._parse(data, { name: _.getFileName(url), icons: {} }));
},

_parse: function(data, props) {
parse: function(data, props) {
return _.isZipped(data) ? this._parseKMZ(data, props) : this._parseKML(data, props);
},

Expand Down

0 comments on commit 30dd04a

Please sign in to comment.