@opengeoweb/webmap 4.7.1 → 4.8.0
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.
- package/index.esm.js +32 -30
- package/index.umd.js +32 -30
- package/lib/components/WMJSMap.d.ts +3 -2
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -4003,7 +4003,6 @@ var version = '3.0.1';
|
|
|
4003
4003
|
/* Global vars */
|
|
4004
4004
|
|
|
4005
4005
|
var WebMapJSMapNo = 0;
|
|
4006
|
-
var WebMapJSMapInstanceIds = [];
|
|
4007
4006
|
var bgMapImageStore = new WMImageStore(bgImageStoreLength, {
|
|
4008
4007
|
id: 'bgMapImageStore'
|
|
4009
4008
|
});
|
|
@@ -4053,6 +4052,8 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4053
4052
|
|
|
4054
4053
|
_classCallCheck(this, WMJSMap);
|
|
4055
4054
|
|
|
4055
|
+
this.internalMapId = '';
|
|
4056
|
+
|
|
4056
4057
|
this.onContextMenu = function () {
|
|
4057
4058
|
return false;
|
|
4058
4059
|
};
|
|
@@ -4120,7 +4121,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4120
4121
|
this.showScaleBarInMap = true;
|
|
4121
4122
|
this.mouseHoverAnimationBox = false;
|
|
4122
4123
|
this.callBack = new WMListener();
|
|
4123
|
-
this.initialized =
|
|
4124
|
+
this.initialized = false;
|
|
4124
4125
|
this.suspendDrawing = false;
|
|
4125
4126
|
this.activeLayer = undefined;
|
|
4126
4127
|
/* Undo: */
|
|
@@ -4329,25 +4330,12 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4329
4330
|
value: function makeComponentId(id) {
|
|
4330
4331
|
var availableId = "WebMapJSMapNo_".concat(WebMapJSMapNo);
|
|
4331
4332
|
|
|
4332
|
-
if (
|
|
4333
|
-
|
|
4334
|
-
if (WebMapJSMapInstanceIds[testDestroyed] === false) {
|
|
4335
|
-
availableId = testDestroyed;
|
|
4336
|
-
this.hasGeneratedId = true;
|
|
4337
|
-
break;
|
|
4338
|
-
}
|
|
4339
|
-
}
|
|
4340
|
-
|
|
4341
|
-
this.mainElement.id = availableId;
|
|
4342
|
-
WebMapJSMapInstanceIds[this.mainElement.id] = true;
|
|
4343
|
-
}
|
|
4344
|
-
|
|
4345
|
-
if (this.hasGeneratedId === false) {
|
|
4346
|
-
this.hasGeneratedId = true;
|
|
4333
|
+
if (this.internalMapId === '') {
|
|
4334
|
+
this.internalMapId = availableId;
|
|
4347
4335
|
WebMapJSMapNo += 1;
|
|
4348
4336
|
}
|
|
4349
4337
|
|
|
4350
|
-
return "".concat(this.
|
|
4338
|
+
return "".concat(this.internalMapId, "_").concat(id);
|
|
4351
4339
|
}
|
|
4352
4340
|
}, {
|
|
4353
4341
|
key: "setMessage",
|
|
@@ -4805,8 +4793,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4805
4793
|
this.bbox.bottom = -90;
|
|
4806
4794
|
this.bbox.right = 180;
|
|
4807
4795
|
this.bbox.top = 90;
|
|
4808
|
-
this.srs = 'EPSG:4326';
|
|
4809
|
-
this.setSize(this.mainElement.clientWidth, this.mainElement.clientHeight); // IMAGE buffer
|
|
4796
|
+
this.srs = 'EPSG:4326'; // IMAGE buffer
|
|
4810
4797
|
|
|
4811
4798
|
this.divBuffer = new WMCanvasBuffer(this.callBack, getMapImageStore, this.getWidth(), this.getHeight(), {
|
|
4812
4799
|
beforecanvasstartdraw: this._adagucBeforeDraw,
|
|
@@ -4820,7 +4807,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4820
4807
|
if (imageEventType === WMImageEventType.Loaded) {
|
|
4821
4808
|
_this3.draw('legendImageStore loaded');
|
|
4822
4809
|
}
|
|
4823
|
-
}, this.
|
|
4810
|
+
}, this.internalMapId);
|
|
4824
4811
|
this.callBack.addToCallback('display', this.display, true);
|
|
4825
4812
|
this.callBack.addToCallback('draw', function () {
|
|
4826
4813
|
debug(DebugType.Log);
|
|
@@ -4829,13 +4816,13 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4829
4816
|
if (imageEventType === WMImageEventType.Loaded) {
|
|
4830
4817
|
_this3.draw('bgMapImageStore loaded');
|
|
4831
4818
|
}
|
|
4832
|
-
}, this.
|
|
4819
|
+
}, this.internalMapId);
|
|
4833
4820
|
|
|
4834
4821
|
this._updateBoundingBox(this.bbox);
|
|
4835
4822
|
|
|
4836
4823
|
this.wmAnimate = new WMJSAnimate(this);
|
|
4837
4824
|
this.wmTileRenderer = new WMTileRenderer();
|
|
4838
|
-
this.initialized =
|
|
4825
|
+
this.initialized = true;
|
|
4839
4826
|
}
|
|
4840
4827
|
}, {
|
|
4841
4828
|
key: "rebuildMapDimensions",
|
|
@@ -5230,9 +5217,9 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5230
5217
|
value: function setSize(w, h) {
|
|
5231
5218
|
var _this6 = this;
|
|
5232
5219
|
|
|
5233
|
-
debug(DebugType.Log);
|
|
5220
|
+
debug(DebugType.Log, 'setSize', w, h, this.initialized);
|
|
5234
5221
|
|
|
5235
|
-
if (w < 4 || h < 4) {
|
|
5222
|
+
if (w < 4 || h < 4 || this.initialized === false) {
|
|
5236
5223
|
return;
|
|
5237
5224
|
}
|
|
5238
5225
|
|
|
@@ -5761,6 +5748,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5761
5748
|
}, {
|
|
5762
5749
|
key: "destroy",
|
|
5763
5750
|
value: function destroy() {
|
|
5751
|
+
if (!this.initialized) return;
|
|
5764
5752
|
this.stopAnimating();
|
|
5765
5753
|
|
|
5766
5754
|
for (var i = this.layers.length - 1; i >= 0; i -= 1) {
|
|
@@ -5769,11 +5757,24 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5769
5757
|
|
|
5770
5758
|
this.detachEvents();
|
|
5771
5759
|
this.callBack.destroy();
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5760
|
+
this.callBack = null;
|
|
5761
|
+
getMapImageStore.removeEventCallback(this.internalMapId);
|
|
5762
|
+
bgMapImageStore.removeEventCallback(this.internalMapId);
|
|
5763
|
+
getLegendImageStore().removeEventCallback(this.internalMapId);
|
|
5764
|
+
this.internalMapId = '';
|
|
5765
|
+
this.mainElement.removeChild(this.baseDiv);
|
|
5766
|
+
this.baseDiv.innerHTML = '';
|
|
5767
|
+
this.divZoomBox.innerHTML = '';
|
|
5768
|
+
this.divBoundingBox.innerHTML = '';
|
|
5769
|
+
this.divDimInfo.innerHTML = '';
|
|
5770
|
+
this.loadingDiv.innerHTML = '';
|
|
5771
|
+
this.baseDiv = undefined;
|
|
5772
|
+
this.divZoomBox = undefined;
|
|
5773
|
+
this.divBoundingBox = undefined;
|
|
5774
|
+
this.divDimInfo = undefined;
|
|
5775
|
+
this.loadingDiv = undefined;
|
|
5776
5776
|
this.isDestroyed = true;
|
|
5777
|
+
this.initialized = false;
|
|
5777
5778
|
}
|
|
5778
5779
|
}, {
|
|
5779
5780
|
key: "detachEvents",
|
|
@@ -6797,7 +6798,8 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
6797
6798
|
}, {
|
|
6798
6799
|
key: "removeListener",
|
|
6799
6800
|
value: function removeListener(name, f) {
|
|
6800
|
-
|
|
6801
|
+
if (this.isDestroyed) return;
|
|
6802
|
+
this.callBack.removeEvents(name, f);
|
|
6801
6803
|
}
|
|
6802
6804
|
}, {
|
|
6803
6805
|
key: "getListener",
|
package/index.umd.js
CHANGED
|
@@ -4059,7 +4059,6 @@
|
|
|
4059
4059
|
/* Global vars */
|
|
4060
4060
|
|
|
4061
4061
|
var WebMapJSMapNo = 0;
|
|
4062
|
-
var WebMapJSMapInstanceIds = [];
|
|
4063
4062
|
var bgMapImageStore = new WMImageStore(bgImageStoreLength, {
|
|
4064
4063
|
id: 'bgMapImageStore'
|
|
4065
4064
|
});
|
|
@@ -4109,6 +4108,8 @@
|
|
|
4109
4108
|
function WMJSMap(_element) {
|
|
4110
4109
|
var _this = this;
|
|
4111
4110
|
|
|
4111
|
+
this.internalMapId = '';
|
|
4112
|
+
|
|
4112
4113
|
this.onContextMenu = function () {
|
|
4113
4114
|
return false;
|
|
4114
4115
|
};
|
|
@@ -4176,7 +4177,7 @@
|
|
|
4176
4177
|
this.showScaleBarInMap = true;
|
|
4177
4178
|
this.mouseHoverAnimationBox = false;
|
|
4178
4179
|
this.callBack = new WMListener();
|
|
4179
|
-
this.initialized =
|
|
4180
|
+
this.initialized = false;
|
|
4180
4181
|
this.suspendDrawing = false;
|
|
4181
4182
|
this.activeLayer = undefined;
|
|
4182
4183
|
/* Undo: */
|
|
@@ -4382,25 +4383,12 @@
|
|
|
4382
4383
|
WMJSMap.prototype.makeComponentId = function (id) {
|
|
4383
4384
|
var availableId = "WebMapJSMapNo_" + WebMapJSMapNo;
|
|
4384
4385
|
|
|
4385
|
-
if (
|
|
4386
|
-
|
|
4387
|
-
if (WebMapJSMapInstanceIds[testDestroyed] === false) {
|
|
4388
|
-
availableId = testDestroyed;
|
|
4389
|
-
this.hasGeneratedId = true;
|
|
4390
|
-
break;
|
|
4391
|
-
}
|
|
4392
|
-
}
|
|
4393
|
-
|
|
4394
|
-
this.mainElement.id = availableId;
|
|
4395
|
-
WebMapJSMapInstanceIds[this.mainElement.id] = true;
|
|
4396
|
-
}
|
|
4397
|
-
|
|
4398
|
-
if (this.hasGeneratedId === false) {
|
|
4399
|
-
this.hasGeneratedId = true;
|
|
4386
|
+
if (this.internalMapId === '') {
|
|
4387
|
+
this.internalMapId = availableId;
|
|
4400
4388
|
WebMapJSMapNo += 1;
|
|
4401
4389
|
}
|
|
4402
4390
|
|
|
4403
|
-
return this.
|
|
4391
|
+
return this.internalMapId + "_" + id;
|
|
4404
4392
|
};
|
|
4405
4393
|
|
|
4406
4394
|
WMJSMap.prototype.setMessage = function (message) {
|
|
@@ -4843,8 +4831,7 @@
|
|
|
4843
4831
|
this.bbox.bottom = -90;
|
|
4844
4832
|
this.bbox.right = 180;
|
|
4845
4833
|
this.bbox.top = 90;
|
|
4846
|
-
this.srs = 'EPSG:4326';
|
|
4847
|
-
this.setSize(this.mainElement.clientWidth, this.mainElement.clientHeight); // IMAGE buffer
|
|
4834
|
+
this.srs = 'EPSG:4326'; // IMAGE buffer
|
|
4848
4835
|
|
|
4849
4836
|
this.divBuffer = new WMCanvasBuffer(this.callBack, getMapImageStore, this.getWidth(), this.getHeight(), {
|
|
4850
4837
|
beforecanvasstartdraw: this._adagucBeforeDraw,
|
|
@@ -4858,7 +4845,7 @@
|
|
|
4858
4845
|
if (imageEventType === exports.WMImageEventType.Loaded) {
|
|
4859
4846
|
_this.draw('legendImageStore loaded');
|
|
4860
4847
|
}
|
|
4861
|
-
}, this.
|
|
4848
|
+
}, this.internalMapId);
|
|
4862
4849
|
this.callBack.addToCallback('display', this.display, true);
|
|
4863
4850
|
this.callBack.addToCallback('draw', function () {
|
|
4864
4851
|
debug(exports.DebugType.Log, 'draw event triggered externally, skipping');
|
|
@@ -4867,13 +4854,13 @@
|
|
|
4867
4854
|
if (imageEventType === exports.WMImageEventType.Loaded) {
|
|
4868
4855
|
_this.draw('bgMapImageStore loaded');
|
|
4869
4856
|
}
|
|
4870
|
-
}, this.
|
|
4857
|
+
}, this.internalMapId);
|
|
4871
4858
|
|
|
4872
4859
|
this._updateBoundingBox(this.bbox);
|
|
4873
4860
|
|
|
4874
4861
|
this.wmAnimate = new WMJSAnimate(this);
|
|
4875
4862
|
this.wmTileRenderer = new WMTileRenderer();
|
|
4876
|
-
this.initialized =
|
|
4863
|
+
this.initialized = true;
|
|
4877
4864
|
};
|
|
4878
4865
|
|
|
4879
4866
|
WMJSMap.prototype.rebuildMapDimensions = function () {
|
|
@@ -5239,9 +5226,9 @@
|
|
|
5239
5226
|
WMJSMap.prototype.setSize = function (w, h) {
|
|
5240
5227
|
var _this = this;
|
|
5241
5228
|
|
|
5242
|
-
debug(exports.DebugType.Log, 'setSize', w, h);
|
|
5229
|
+
debug(exports.DebugType.Log, 'setSize', w, h, this.initialized);
|
|
5243
5230
|
|
|
5244
|
-
if (w < 4 || h < 4) {
|
|
5231
|
+
if (w < 4 || h < 4 || this.initialized === false) {
|
|
5245
5232
|
return;
|
|
5246
5233
|
}
|
|
5247
5234
|
|
|
@@ -5748,6 +5735,7 @@
|
|
|
5748
5735
|
};
|
|
5749
5736
|
|
|
5750
5737
|
WMJSMap.prototype.destroy = function () {
|
|
5738
|
+
if (!this.initialized) return;
|
|
5751
5739
|
this.stopAnimating();
|
|
5752
5740
|
|
|
5753
5741
|
for (var i = this.layers.length - 1; i >= 0; i -= 1) {
|
|
@@ -5756,11 +5744,24 @@
|
|
|
5756
5744
|
|
|
5757
5745
|
this.detachEvents();
|
|
5758
5746
|
this.callBack.destroy();
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5747
|
+
this.callBack = null;
|
|
5748
|
+
getMapImageStore.removeEventCallback(this.internalMapId);
|
|
5749
|
+
bgMapImageStore.removeEventCallback(this.internalMapId);
|
|
5750
|
+
getLegendImageStore().removeEventCallback(this.internalMapId);
|
|
5751
|
+
this.internalMapId = '';
|
|
5752
|
+
this.mainElement.removeChild(this.baseDiv);
|
|
5753
|
+
this.baseDiv.innerHTML = '';
|
|
5754
|
+
this.divZoomBox.innerHTML = '';
|
|
5755
|
+
this.divBoundingBox.innerHTML = '';
|
|
5756
|
+
this.divDimInfo.innerHTML = '';
|
|
5757
|
+
this.loadingDiv.innerHTML = '';
|
|
5758
|
+
this.baseDiv = undefined;
|
|
5759
|
+
this.divZoomBox = undefined;
|
|
5760
|
+
this.divBoundingBox = undefined;
|
|
5761
|
+
this.divDimInfo = undefined;
|
|
5762
|
+
this.loadingDiv = undefined;
|
|
5763
5763
|
this.isDestroyed = true;
|
|
5764
|
+
this.initialized = false;
|
|
5764
5765
|
};
|
|
5765
5766
|
|
|
5766
5767
|
WMJSMap.prototype.detachEvents = function () {
|
|
@@ -6746,7 +6747,8 @@
|
|
|
6746
6747
|
};
|
|
6747
6748
|
|
|
6748
6749
|
WMJSMap.prototype.removeListener = function (name, f) {
|
|
6749
|
-
|
|
6750
|
+
if (this.isDestroyed) return;
|
|
6751
|
+
this.callBack.removeEvents(name, f);
|
|
6750
6752
|
};
|
|
6751
6753
|
|
|
6752
6754
|
WMJSMap.prototype.getListener = function () {
|
|
@@ -59,14 +59,15 @@ export default class WMJSMap {
|
|
|
59
59
|
private loadedBBOX;
|
|
60
60
|
drawnBBOX: WMBBOX;
|
|
61
61
|
private divBuffer;
|
|
62
|
-
private isDestroyed;
|
|
63
62
|
private mapHeader;
|
|
64
63
|
private currentCursor;
|
|
65
64
|
private mapIsActivated;
|
|
66
65
|
private isMapHeaderEnabled;
|
|
67
66
|
private showScaleBarInMap;
|
|
68
67
|
private callBack;
|
|
69
|
-
|
|
68
|
+
initialized: boolean;
|
|
69
|
+
isDestroyed: boolean;
|
|
70
|
+
private internalMapId;
|
|
70
71
|
private suspendDrawing;
|
|
71
72
|
private activeLayer;
|
|
72
73
|
private MaxUndos;
|