@emuanalytics/flow-rdf-ui 4.0.14 → 4.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,14 +50,17 @@ class FlowUiMap extends FlowRdfElement {
50
50
  return this._initialized;
51
51
  }
52
52
  handleCenterChange() {
53
+ const center = {
54
+ lng: this.center[0],
55
+ lat: this.center[1],
56
+ bearing: this.bearing,
57
+ pitch: this.pitch,
58
+ zoom: this.zoom
59
+ };
53
60
  if (this._map) {
54
- this._map.setCenter({
55
- lng: this.center[0],
56
- lat: this.center[1],
57
- bearing: this.bearing,
58
- pitch: this.pitch,
59
- zoom: this.zoom
60
- });
61
+ this._map.setCenter(center);
62
+ } else {
63
+ this._pendingCenter = center;
61
64
  }
62
65
  }
63
66
  handleBaseStyleChange() {
@@ -94,6 +97,10 @@ class FlowUiMap extends FlowRdfElement {
94
97
  bearingSnap: this.bearingSnap
95
98
  });
96
99
  await map.initialized;
100
+ if (this._pendingCenter) {
101
+ map.setCenter(this._pendingCenter);
102
+ this._pendingCenter = void 0;
103
+ }
97
104
  map.on("loading", (ev) => {
98
105
  this._mapLoading = ev.loading;
99
106
  });