Skip to content

Commit 8ce09b0

Browse files
Merge pull request #1458 from umap-project/fix-datachanged
Make sure DataLayer._dataloaded is set only once all data is imported
2 parents e84f5b1 + f54992c commit 8ce09b0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

umap/static/umap/js/umap.layer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ L.U.DataLayer = L.Evented.extend({
665665
this.backupOptions()
666666
this.fire('loaded')
667667
this._loading = false
668-
this._dataloaded = true
669668
},
670669
context: this,
671670
})
@@ -674,6 +673,7 @@ L.U.DataLayer = L.Evented.extend({
674673
fromGeoJSON: function (geojson) {
675674
this.addData(geojson)
676675
this._geojson = geojson
676+
this._dataloaded = true
677677
this.fire('dataloaded')
678678
this.fire('datachanged')
679679
},
@@ -730,7 +730,6 @@ L.U.DataLayer = L.Evented.extend({
730730
verb: 'GET',
731731
callback: (raw) => {
732732
this.clear()
733-
this._dataloaded = true
734733
this.rawToGeoJSON(raw, this.options.remoteData.format, (geojson) =>
735734
this.fromGeoJSON(geojson)
736735
)

0 commit comments

Comments
 (0)