Skip to content

Commit

Permalink
Merge pull request #1458 from umap-project/fix-datachanged
Browse files Browse the repository at this point in the history
Make sure DataLayer._dataloaded is set only once all data is imported
  • Loading branch information
yohanboniface authored Dec 12, 2023
2 parents e84f5b1 + f54992c commit 8ce09b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions umap/static/umap/js/umap.layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ L.U.DataLayer = L.Evented.extend({
this.backupOptions()
this.fire('loaded')
this._loading = false
this._dataloaded = true
},
context: this,
})
Expand All @@ -674,6 +673,7 @@ L.U.DataLayer = L.Evented.extend({
fromGeoJSON: function (geojson) {
this.addData(geojson)
this._geojson = geojson
this._dataloaded = true
this.fire('dataloaded')
this.fire('datachanged')
},
Expand Down Expand Up @@ -730,7 +730,6 @@ L.U.DataLayer = L.Evented.extend({
verb: 'GET',
callback: (raw) => {
this.clear()
this._dataloaded = true
this.rawToGeoJSON(raw, this.options.remoteData.format, (geojson) =>
this.fromGeoJSON(geojson)
)
Expand Down

0 comments on commit 8ce09b0

Please sign in to comment.