@opengeoweb/webmap 2.0.1 → 2.1.3
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/lib/components/WMDrawMarker.d.ts +1 -1
- package/lib/components/WMGetServiceFromStore.d.ts +1 -1
- package/lib/components/WMJSMap.d.ts +1 -2
- package/lib/components/WMJSService.d.ts +6 -7
- package/lib/components/WMLayer.d.ts +6 -12
- package/package.json +1 -1
- package/webmap.esm.js +139 -140
- package/webmap.umd.js +128 -136
package/webmap.esm.js
CHANGED
|
@@ -3399,7 +3399,6 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
3399
3399
|
* */
|
|
3400
3400
|
var WMDrawMarker = function WMDrawMarker(context, coordx, coordy) {
|
|
3401
3401
|
var fillColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '#FFF';
|
|
3402
|
-
var outlineColor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '#000';
|
|
3403
3402
|
var ctx = context;
|
|
3404
3403
|
var coord = {
|
|
3405
3404
|
x: parseInt(coordx.toString(), 10),
|
|
@@ -3408,8 +3407,8 @@ var WMDrawMarker = function WMDrawMarker(context, coordx, coordy) {
|
|
|
3408
3407
|
ctx.fillStyle = fillColor;
|
|
3409
3408
|
ctx.globalAlpha = 1.0;
|
|
3410
3409
|
ctx.beginPath();
|
|
3411
|
-
var topRadius =
|
|
3412
|
-
var topHeight = 2
|
|
3410
|
+
var topRadius = 7;
|
|
3411
|
+
var topHeight = 2 * topRadius;
|
|
3413
3412
|
ctx.arc(coord.x, coord.y - topHeight, topRadius, Math.PI, Math.PI * 2);
|
|
3414
3413
|
ctx.bezierCurveTo(coord.x + topRadius, coord.y - topHeight, coord.x + topRadius / 1.6, coord.y - topRadius, coord.x, coord.y);
|
|
3415
3414
|
ctx.bezierCurveTo(coord.x, coord.y, coord.x - topRadius / 1.6, coord.y - topRadius, coord.x - topRadius, coord.y - topHeight);
|
|
@@ -3419,13 +3418,7 @@ var WMDrawMarker = function WMDrawMarker(context, coordx, coordy) {
|
|
|
3419
3418
|
|
|
3420
3419
|
ctx.fillStyle = '#FFF';
|
|
3421
3420
|
ctx.beginPath();
|
|
3422
|
-
ctx.arc(coord.x, coord.y - topHeight, topRadius / 2, Math.PI * 2, 0);
|
|
3423
|
-
ctx.fill();
|
|
3424
|
-
/* Fill marker exact location */
|
|
3425
|
-
|
|
3426
|
-
ctx.fillStyle = outlineColor;
|
|
3427
|
-
ctx.beginPath();
|
|
3428
|
-
ctx.arc(coord.x, coord.y, 2, Math.PI * 2, 0);
|
|
3421
|
+
ctx.arc(coord.x, coord.y - topHeight, topRadius / 2.5, Math.PI * 2, 0);
|
|
3429
3422
|
ctx.fill();
|
|
3430
3423
|
};
|
|
3431
3424
|
|
|
@@ -3506,7 +3499,7 @@ var MapPin = /*#__PURE__*/function () {
|
|
|
3506
3499
|
key: "drawMarker",
|
|
3507
3500
|
value: function drawMarker(ctx) {
|
|
3508
3501
|
if (isDefined(this.x) && isDefined(this.y)) {
|
|
3509
|
-
WMDrawMarker(ctx, this.x, this.y, '#
|
|
3502
|
+
WMDrawMarker(ctx, this.x, this.y, '#051039');
|
|
3510
3503
|
}
|
|
3511
3504
|
}
|
|
3512
3505
|
}]);
|
|
@@ -3967,7 +3960,6 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
3967
3960
|
this.previousMouseButtonState = 'up';
|
|
3968
3961
|
/* Binds */
|
|
3969
3962
|
|
|
3970
|
-
this.setXML2JSONURL = this.setXML2JSONURL.bind(this);
|
|
3971
3963
|
this.setWMTileRendererTileSettings = this.setWMTileRendererTileSettings.bind(this);
|
|
3972
3964
|
this.makeComponentId = this.makeComponentId.bind(this);
|
|
3973
3965
|
this.setMessage = this.setMessage.bind(this);
|
|
@@ -4093,11 +4085,6 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4093
4085
|
}
|
|
4094
4086
|
|
|
4095
4087
|
_createClass(WMJSMap, [{
|
|
4096
|
-
key: "setXML2JSONURL",
|
|
4097
|
-
value: function setXML2JSONURL(_xml2jsonrequest) {
|
|
4098
|
-
this.xml2jsonrequest = _xml2jsonrequest;
|
|
4099
|
-
}
|
|
4100
|
-
}, {
|
|
4101
4088
|
key: "setWMTileRendererTileSettings",
|
|
4102
4089
|
value: function setWMTileRendererTileSettings(_WMTileRendererTileSettings) {
|
|
4103
4090
|
this.tileRenderSettings = _WMTileRendererTileSettings;
|
|
@@ -4419,6 +4406,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4419
4406
|
|
|
4420
4407
|
ctx.font = '10px Helvetica';
|
|
4421
4408
|
ctx.textBaseline = 'middle';
|
|
4409
|
+
ctx.textAlign = 'left';
|
|
4422
4410
|
|
|
4423
4411
|
if (isDefined(this.mouseGeoCoordXY)) {
|
|
4424
4412
|
var roundingFactor = 1.0 / Math.pow(10, parseInt(Math.log((this.bbox.right - this.bbox.left) / this.width) / Math.log(10), 10) - 2);
|
|
@@ -4453,6 +4441,30 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4453
4441
|
|
|
4454
4442
|
ctx.fillStyle = '#000000';
|
|
4455
4443
|
ctx.fillText("Map projection: ".concat(this.srs), 5, this.height - 26);
|
|
4444
|
+
/* Show layer metadata */
|
|
4445
|
+
|
|
4446
|
+
if (this.showLayerInfo === true) {
|
|
4447
|
+
var metadataX = 100;
|
|
4448
|
+
var metadataY = 100;
|
|
4449
|
+
var dimStartX = 150;
|
|
4450
|
+
var rowHeight = 26;
|
|
4451
|
+
var rowNumber = 0;
|
|
4452
|
+
drawTextBG(ctx, 'Layer name', metadataX, metadataY + rowNumber * rowHeight, 10);
|
|
4453
|
+
drawTextBG(ctx, 'Dimensions', metadataX + dimStartX, metadataY + rowNumber * rowHeight, 10);
|
|
4454
|
+
rowNumber += 1;
|
|
4455
|
+
|
|
4456
|
+
for (var _j3 = 0; _j3 < this.layers.length; _j3 += 1) {
|
|
4457
|
+
var layer = this.layers[_j3];
|
|
4458
|
+
drawTextBG(ctx, "#".concat(_j3, ":").concat(layer.name), metadataX, metadataY + rowNumber * rowHeight, 10);
|
|
4459
|
+
|
|
4460
|
+
for (var d = 0; d < layer.dimensions.length; d += 1) {
|
|
4461
|
+
var dimension = layer.dimensions[d];
|
|
4462
|
+
drawTextBG(ctx, "".concat(dimension.name, " = ").concat(dimension.currentValue), metadataX + d * 200 + dimStartX, metadataY + rowNumber * rowHeight, 10);
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4465
|
+
rowNumber += 1;
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4456
4468
|
}
|
|
4457
4469
|
/* Is called when the WebMapJS object is created */
|
|
4458
4470
|
|
|
@@ -4604,8 +4616,8 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4604
4616
|
}
|
|
4605
4617
|
|
|
4606
4618
|
for (var i = 0; i < this.layers.length; i += 1) {
|
|
4607
|
-
for (var
|
|
4608
|
-
var dim = this.layers[i].dimensions[
|
|
4619
|
+
for (var _j4 = 0; _j4 < this.layers[i].dimensions.length; _j4 += 1) {
|
|
4620
|
+
var dim = this.layers[i].dimensions[_j4];
|
|
4609
4621
|
var mapdim = this.getDimension(dim.name);
|
|
4610
4622
|
|
|
4611
4623
|
if (isDefined(mapdim)) {
|
|
@@ -4618,10 +4630,10 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4618
4630
|
}
|
|
4619
4631
|
}
|
|
4620
4632
|
|
|
4621
|
-
for (var
|
|
4622
|
-
if (this.mapdimensions[
|
|
4623
|
-
this.mapdimensions.splice(
|
|
4624
|
-
|
|
4633
|
+
for (var _j5 = 0; _j5 < this.mapdimensions.length; _j5 += 1) {
|
|
4634
|
+
if (this.mapdimensions[_j5].used === false) {
|
|
4635
|
+
this.mapdimensions.splice(_j5, 1);
|
|
4636
|
+
_j5 -= 1;
|
|
4625
4637
|
}
|
|
4626
4638
|
}
|
|
4627
4639
|
|
|
@@ -4880,10 +4892,10 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4880
4892
|
reject(new Error('layer has no constructor'));
|
|
4881
4893
|
return;
|
|
4882
4894
|
}
|
|
4895
|
+
/* Set a reference in the layer to this map */
|
|
4883
4896
|
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
}
|
|
4897
|
+
|
|
4898
|
+
layer.parentMap = _this5;
|
|
4887
4899
|
|
|
4888
4900
|
_this5.layers.push(layer);
|
|
4889
4901
|
|
|
@@ -4920,6 +4932,11 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4920
4932
|
}
|
|
4921
4933
|
|
|
4922
4934
|
if (!_srs) _srs = 'EPSG:4326';
|
|
4935
|
+
|
|
4936
|
+
if (this.srs !== _srs) {
|
|
4937
|
+
this.defaultBBOX.setBBOX(_bbox);
|
|
4938
|
+
}
|
|
4939
|
+
|
|
4923
4940
|
this.srs = _srs;
|
|
4924
4941
|
|
|
4925
4942
|
if (this.proj4.srs !== this.srs || !isDefined(this.proj4.projection)) {
|
|
@@ -4933,7 +4950,6 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4933
4950
|
}
|
|
4934
4951
|
|
|
4935
4952
|
this.setBBOX(_bbox);
|
|
4936
|
-
this.defaultBBOX.setBBOX(_bbox);
|
|
4937
4953
|
this.updateMouseCursorCoordinates(undefined);
|
|
4938
4954
|
this.callBack.triggerEvent('onsetprojection', [this.srs, this.bbox]);
|
|
4939
4955
|
}
|
|
@@ -5239,12 +5255,19 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5239
5255
|
if (animationList !== undefined) {
|
|
5240
5256
|
if (_typeof(animationList) === 'object') {
|
|
5241
5257
|
if (animationList.length > 0) {
|
|
5258
|
+
// Ensure the time dimension has been loaded for the map before starting animation
|
|
5259
|
+
var timeDim = this.getDimension('time');
|
|
5260
|
+
|
|
5261
|
+
if (!timeDim) {
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
|
|
5265
|
+
var selectedTime = timeDim.currentValue;
|
|
5242
5266
|
this.isAnimating = true;
|
|
5243
5267
|
this.callBack.triggerEvent('onstartanimation', this);
|
|
5244
5268
|
this.currentAnimationStep = 0;
|
|
5245
5269
|
this.animationList = [];
|
|
5246
5270
|
this.mouseHoverAnimationBox = false;
|
|
5247
|
-
var selectedTime = this.getDimension('time').currentValue;
|
|
5248
5271
|
|
|
5249
5272
|
for (var j = 0; j < animationList.length; j += 1) {
|
|
5250
5273
|
if (selectedTime && animationList[j].value === selectedTime) {
|
|
@@ -5422,9 +5445,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5422
5445
|
this.baseLayers = layer;
|
|
5423
5446
|
|
|
5424
5447
|
for (var j = 0; j < this.baseLayers.length; j += 1) {
|
|
5425
|
-
|
|
5426
|
-
this.baseLayers[j].parentMaps.push(this);
|
|
5427
|
-
}
|
|
5448
|
+
this.baseLayers[j].parentMap = this;
|
|
5428
5449
|
|
|
5429
5450
|
if (this.baseLayers[j].keepOnTop !== true) {
|
|
5430
5451
|
this.numBaseLayers += 1;
|
|
@@ -6648,17 +6669,17 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
6648
6669
|
this.WMProjectionTempUndo[j] = this.WMProjectionUndo[j];
|
|
6649
6670
|
}
|
|
6650
6671
|
|
|
6651
|
-
for (var
|
|
6652
|
-
this.WMProjectionUndo[
|
|
6672
|
+
for (var _j6 = 0; _j6 <= this.UndoPointer; _j6 += 1) {
|
|
6673
|
+
this.WMProjectionUndo[_j6] = this.WMProjectionTempUndo[this.UndoPointer - _j6];
|
|
6653
6674
|
}
|
|
6654
6675
|
|
|
6655
6676
|
this.UndoPointer = 0;
|
|
6656
6677
|
}
|
|
6657
6678
|
|
|
6658
|
-
for (var
|
|
6659
|
-
this.WMProjectionUndo[
|
|
6679
|
+
for (var _j7 = this.MaxUndos - 1; _j7 > 0; _j7 -= 1) {
|
|
6680
|
+
this.WMProjectionUndo[_j7].bbox.setBBOX(this.WMProjectionUndo[_j7 - 1].bbox);
|
|
6660
6681
|
|
|
6661
|
-
this.WMProjectionUndo[
|
|
6682
|
+
this.WMProjectionUndo[_j7].srs = this.WMProjectionUndo[_j7 - 1].srs;
|
|
6662
6683
|
}
|
|
6663
6684
|
|
|
6664
6685
|
this.WMProjectionUndo[0].bbox.setBBOX(this.bbox);
|
|
@@ -7324,8 +7345,8 @@ var getWMSUrl = function getWMSUrl() {
|
|
|
7324
7345
|
* Global getcapabilities function
|
|
7325
7346
|
*/
|
|
7326
7347
|
|
|
7327
|
-
var WMJSGetCapabilities = function WMJSGetCapabilities(service, succes, fail,
|
|
7328
|
-
var disableCache = arguments.length >
|
|
7348
|
+
var WMJSGetCapabilities = function WMJSGetCapabilities(service, succes, fail, options) {
|
|
7349
|
+
var disableCache = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
7329
7350
|
|
|
7330
7351
|
/* Make the getCapabilitiesJSONrequest */
|
|
7331
7352
|
var headers = [];
|
|
@@ -7369,7 +7390,6 @@ var WMJSGetCapabilities = function WMJSGetCapabilities(service, succes, fail, xm
|
|
|
7369
7390
|
random: Math.random()
|
|
7370
7391
|
} : {};
|
|
7371
7392
|
var url = getWMSUrl(service, addParams);
|
|
7372
|
-
var newXml2jsonrequestURL = xml2jsonrequestURL;
|
|
7373
7393
|
WMXMLParser(url, headers).then(function (data) {
|
|
7374
7394
|
try {
|
|
7375
7395
|
succes(data);
|
|
@@ -7379,7 +7399,7 @@ var WMJSGetCapabilities = function WMJSGetCapabilities(service, succes, fail, xm
|
|
|
7379
7399
|
})["catch"](function () {
|
|
7380
7400
|
loadGetCapabilitiesViaProxy(url, succes, function () {
|
|
7381
7401
|
fail("Request failed for ".concat(url));
|
|
7382
|
-
},
|
|
7402
|
+
}, WMServiceStoreXML2JSONRequest.proxy);
|
|
7383
7403
|
});
|
|
7384
7404
|
};
|
|
7385
7405
|
var sortByKey = function sortByKey(array, key) {
|
|
@@ -7410,7 +7430,11 @@ rootNode, path) {
|
|
|
7410
7430
|
name: layers[j].Name.value,
|
|
7411
7431
|
text: layers[j].Title.value,
|
|
7412
7432
|
leaf: isleaf,
|
|
7413
|
-
path: path
|
|
7433
|
+
path: path,
|
|
7434
|
+
keywords: toArray(layers[j].KeywordList && layers[j].KeywordList.Keyword).map(function (keywords) {
|
|
7435
|
+
return keywords.value;
|
|
7436
|
+
}),
|
|
7437
|
+
"abstract": layers[j].Abstract && layers[j].Abstract.value
|
|
7414
7438
|
};
|
|
7415
7439
|
} else {
|
|
7416
7440
|
var nodeText = isNull(layers[j].Title) ? 'Layer' : layers[j].Title.value;
|
|
@@ -7436,7 +7460,6 @@ rootNode, path) {
|
|
|
7436
7460
|
*
|
|
7437
7461
|
* options:
|
|
7438
7462
|
* service
|
|
7439
|
-
* xml2jsonrequestURL
|
|
7440
7463
|
* title (optional)
|
|
7441
7464
|
*/
|
|
7442
7465
|
|
|
@@ -7457,7 +7480,6 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7457
7480
|
if (options) {
|
|
7458
7481
|
this.service = options.service;
|
|
7459
7482
|
this.title = options.title;
|
|
7460
|
-
this.xml2jsonrequestURL = options.xml2jsonrequestURL;
|
|
7461
7483
|
}
|
|
7462
7484
|
|
|
7463
7485
|
this.checkVersion111 = this.checkVersion111.bind(this);
|
|
@@ -7580,7 +7602,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7580
7602
|
|
|
7581
7603
|
}, {
|
|
7582
7604
|
key: "getCapabilities",
|
|
7583
|
-
value: function getCapabilities(succescallback, failcallback, forceReload,
|
|
7605
|
+
value: function getCapabilities(succescallback, failcallback, forceReload, options) {
|
|
7584
7606
|
var _this = this;
|
|
7585
7607
|
|
|
7586
7608
|
if (options) {
|
|
@@ -7665,7 +7687,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7665
7687
|
return null;
|
|
7666
7688
|
}, function () {
|
|
7667
7689
|
return null;
|
|
7668
|
-
}, false,
|
|
7690
|
+
}, false, options);
|
|
7669
7691
|
|
|
7670
7692
|
var current;
|
|
7671
7693
|
|
|
@@ -7674,7 +7696,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7674
7696
|
}
|
|
7675
7697
|
};
|
|
7676
7698
|
|
|
7677
|
-
WMJSGetCapabilities(this.service, succes, fail,
|
|
7699
|
+
WMJSGetCapabilities(this.service, succes, fail, options);
|
|
7678
7700
|
} else {
|
|
7679
7701
|
/* The callbacks are not allowed to be called in the scope of this object.
|
|
7680
7702
|
By using window.setTimeOut they are externally called
|
|
@@ -7720,11 +7742,9 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7720
7742
|
|
|
7721
7743
|
}, {
|
|
7722
7744
|
key: "getNodes",
|
|
7723
|
-
value: function getNodes(succes, failure, forceReload) {
|
|
7745
|
+
value: function getNodes(succes, failure, forceReload, options) {
|
|
7724
7746
|
var _this2 = this;
|
|
7725
7747
|
|
|
7726
|
-
var xml2jsonrequestURL = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.xml2jsonrequestURL;
|
|
7727
|
-
var options = arguments.length > 4 ? arguments[4] : undefined;
|
|
7728
7748
|
this.nodeCache = undefined;
|
|
7729
7749
|
|
|
7730
7750
|
if (!failure) {
|
|
@@ -7739,7 +7759,9 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7739
7759
|
leaf: false,
|
|
7740
7760
|
expanded: true,
|
|
7741
7761
|
children: [],
|
|
7742
|
-
text: ''
|
|
7762
|
+
text: '',
|
|
7763
|
+
keywords: [],
|
|
7764
|
+
"abstract": ''
|
|
7743
7765
|
};
|
|
7744
7766
|
|
|
7745
7767
|
var rootLayer = _this2.getCapabilityElement(jsonData).Layer;
|
|
@@ -7771,7 +7793,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7771
7793
|
failure(data);
|
|
7772
7794
|
};
|
|
7773
7795
|
|
|
7774
|
-
this.getCapabilities(callback, fail, forceReload,
|
|
7796
|
+
this.getCapabilities(callback, fail, forceReload, options);
|
|
7775
7797
|
}
|
|
7776
7798
|
/** Calls succes with an array of all layerobjects
|
|
7777
7799
|
* Calls failure when something goes wrong
|
|
@@ -7782,13 +7804,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7782
7804
|
value: function getLayerObjectsFlat(succes, failure, forceReload) {
|
|
7783
7805
|
var _this3 = this;
|
|
7784
7806
|
|
|
7785
|
-
var
|
|
7786
|
-
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this._options;
|
|
7787
|
-
|
|
7788
|
-
if (!xml2jsonrequestURL) {
|
|
7789
|
-
// eslint-disable-next-line no-param-reassign
|
|
7790
|
-
xml2jsonrequestURL = this.xml2jsonrequestURL;
|
|
7791
|
-
}
|
|
7807
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this._options;
|
|
7792
7808
|
|
|
7793
7809
|
if (isDefined(this._flatLayerObject) && forceReload !== true) {
|
|
7794
7810
|
succes(this._flatLayerObject);
|
|
@@ -7814,7 +7830,7 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7814
7830
|
succes(_this3._flatLayerObject);
|
|
7815
7831
|
};
|
|
7816
7832
|
|
|
7817
|
-
this.getNodes(callback, failure, forceReload,
|
|
7833
|
+
this.getNodes(callback, failure, forceReload, options);
|
|
7818
7834
|
}
|
|
7819
7835
|
}]);
|
|
7820
7836
|
|
|
@@ -7838,20 +7854,15 @@ var WMJSService = /*#__PURE__*/function () {
|
|
|
7838
7854
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
7839
7855
|
* */
|
|
7840
7856
|
|
|
7841
|
-
var WMGetServiceFromStore = function WMGetServiceFromStore(serviceName
|
|
7857
|
+
var WMGetServiceFromStore = function WMGetServiceFromStore(serviceName) {
|
|
7842
7858
|
for (var j = 0; j < WMServiceStore.length; j += 1) {
|
|
7843
7859
|
if (WMServiceStore[j].service === serviceName) {
|
|
7844
7860
|
return WMServiceStore[j];
|
|
7845
7861
|
}
|
|
7846
7862
|
}
|
|
7847
7863
|
|
|
7848
|
-
if (xml2jsonrequestURL) {
|
|
7849
|
-
WMServiceStoreXML2JSONRequest.proxy = xml2jsonrequestURL;
|
|
7850
|
-
}
|
|
7851
|
-
|
|
7852
7864
|
var service = new WMJSService({
|
|
7853
|
-
service: serviceName
|
|
7854
|
-
xml2jsonrequestURL: WMServiceStoreXML2JSONRequest.proxy
|
|
7865
|
+
service: serviceName
|
|
7855
7866
|
});
|
|
7856
7867
|
WMServiceStore.push(service);
|
|
7857
7868
|
return service;
|
|
@@ -7993,8 +8004,8 @@ var addDimsForLayer = function addDimsForLayer(layerObjectFromWMS, layer, layerD
|
|
|
7993
8004
|
});
|
|
7994
8005
|
/* Check if the dimension should take the value from the map */
|
|
7995
8006
|
|
|
7996
|
-
if (layer.
|
|
7997
|
-
var mapDim = layer.
|
|
8007
|
+
if (layer.parentMap) {
|
|
8008
|
+
var mapDim = layer.parentMap.getDimension(layerDim.name);
|
|
7998
8009
|
|
|
7999
8010
|
if (mapDim && mapDim.linked && isDefined(mapDim.currentValue)) {
|
|
8000
8011
|
var dimensionCurrentValue = dimension.getClosestValue(mapDim.currentValue);
|
|
@@ -8099,8 +8110,8 @@ var configureDimensions = function configureDimensions(nestedLayerPath, wmLayer)
|
|
|
8099
8110
|
wmLayer.handleReferenceTime('reference_time', refTimeDimension.getValue());
|
|
8100
8111
|
}
|
|
8101
8112
|
|
|
8102
|
-
if (wmLayer.
|
|
8103
|
-
wmLayer.
|
|
8113
|
+
if (wmLayer.parentMap) {
|
|
8114
|
+
wmLayer.parentMap.configureMapDimensions(wmLayer);
|
|
8104
8115
|
}
|
|
8105
8116
|
};
|
|
8106
8117
|
|
|
@@ -8200,8 +8211,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8200
8211
|
this.type = options.type;
|
|
8201
8212
|
}
|
|
8202
8213
|
|
|
8203
|
-
if (options.
|
|
8204
|
-
this.
|
|
8214
|
+
if (options.parentMap) {
|
|
8215
|
+
this.parentMap = options.parentMap;
|
|
8205
8216
|
}
|
|
8206
8217
|
|
|
8207
8218
|
if (options.headers) {
|
|
@@ -8217,8 +8228,6 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8217
8228
|
this.timer = undefined;
|
|
8218
8229
|
this.service = undefined; // URL of the WMS Service
|
|
8219
8230
|
|
|
8220
|
-
this.WMJSService = undefined; // Corresponding WMJSService
|
|
8221
|
-
|
|
8222
8231
|
this.getmapURL = undefined;
|
|
8223
8232
|
this.getfeatureinfoURL = undefined;
|
|
8224
8233
|
this.getlegendgraphicURL = undefined;
|
|
@@ -8249,9 +8258,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8249
8258
|
this.id = '-1';
|
|
8250
8259
|
this.opacity = 1.0; // Ranges from 0.0-1.0
|
|
8251
8260
|
|
|
8252
|
-
this.getCapabilitiesDoc = undefined;
|
|
8253
8261
|
this.serviceTitle = 'not defined';
|
|
8254
|
-
this.
|
|
8262
|
+
this.parentMap = null;
|
|
8255
8263
|
this.sldURL = null;
|
|
8256
8264
|
this.isConfigured = false;
|
|
8257
8265
|
}
|
|
@@ -8270,7 +8278,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8270
8278
|
if (this.autoupdate) {
|
|
8271
8279
|
var numDeltaMS = 60000;
|
|
8272
8280
|
this.timer = setInterval(function () {
|
|
8273
|
-
_this.parseLayer(undefined, true
|
|
8281
|
+
_this.parseLayer(undefined, true);
|
|
8274
8282
|
}, numDeltaMS);
|
|
8275
8283
|
} else {
|
|
8276
8284
|
clearInterval(this.timer);
|
|
@@ -8288,7 +8296,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8288
8296
|
clearInterval(this.timer);
|
|
8289
8297
|
} else {
|
|
8290
8298
|
this.timer = setInterval(function () {
|
|
8291
|
-
_this2.parseLayer(callback, true
|
|
8299
|
+
_this2.parseLayer(callback, true);
|
|
8292
8300
|
}, interval);
|
|
8293
8301
|
}
|
|
8294
8302
|
}
|
|
@@ -8297,10 +8305,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8297
8305
|
key: "setOpacity",
|
|
8298
8306
|
value: function setOpacity(opacityValue) {
|
|
8299
8307
|
this.opacity = parseFloat(opacityValue);
|
|
8300
|
-
|
|
8301
|
-
for (var j = 0; j < this.parentMaps.length; j += 1) {
|
|
8302
|
-
this.parentMaps[j].redrawBuffer();
|
|
8303
|
-
}
|
|
8308
|
+
this.parentMap && this.parentMap.redrawBuffer();
|
|
8304
8309
|
}
|
|
8305
8310
|
}, {
|
|
8306
8311
|
key: "getOpacity",
|
|
@@ -8310,9 +8315,9 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8310
8315
|
}, {
|
|
8311
8316
|
key: "remove",
|
|
8312
8317
|
value: function remove() {
|
|
8313
|
-
|
|
8314
|
-
this.
|
|
8315
|
-
this.
|
|
8318
|
+
if (this.parentMap) {
|
|
8319
|
+
this.parentMap.deleteLayer(this);
|
|
8320
|
+
this.parentMap.draw('WMLayer::remove');
|
|
8316
8321
|
}
|
|
8317
8322
|
|
|
8318
8323
|
clearInterval(this.timer);
|
|
@@ -8320,31 +8325,31 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8320
8325
|
}, {
|
|
8321
8326
|
key: "moveUp",
|
|
8322
8327
|
value: function moveUp() {
|
|
8323
|
-
|
|
8324
|
-
this.
|
|
8325
|
-
this.
|
|
8328
|
+
if (this.parentMap) {
|
|
8329
|
+
this.parentMap.moveLayerUp(this);
|
|
8330
|
+
this.parentMap.draw('WMLayer::moveUp');
|
|
8326
8331
|
}
|
|
8327
8332
|
}
|
|
8328
8333
|
}, {
|
|
8329
8334
|
key: "moveDown",
|
|
8330
8335
|
value: function moveDown() {
|
|
8331
|
-
|
|
8332
|
-
this.
|
|
8333
|
-
this.
|
|
8336
|
+
if (this.parentMap) {
|
|
8337
|
+
this.parentMap.moveLayerDown(this);
|
|
8338
|
+
this.parentMap.draw('WMLayer::moveDown');
|
|
8334
8339
|
}
|
|
8335
8340
|
}
|
|
8336
8341
|
}, {
|
|
8337
8342
|
key: "zoomToLayer",
|
|
8338
8343
|
value: function zoomToLayer() {
|
|
8339
|
-
|
|
8340
|
-
this.
|
|
8344
|
+
if (this.parentMap) {
|
|
8345
|
+
this.parentMap.zoomToLayer(this);
|
|
8341
8346
|
}
|
|
8342
8347
|
}
|
|
8343
8348
|
}, {
|
|
8344
8349
|
key: "draw",
|
|
8345
8350
|
value: function draw(e) {
|
|
8346
|
-
|
|
8347
|
-
this.
|
|
8351
|
+
if (this.parentMap) {
|
|
8352
|
+
this.parentMap.draw("WMLayer::draw::".concat(e));
|
|
8348
8353
|
}
|
|
8349
8354
|
}
|
|
8350
8355
|
}, {
|
|
@@ -8360,9 +8365,9 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8360
8365
|
timeDim.setTimeValuesForReferenceTime(value, referenceTimeDim);
|
|
8361
8366
|
|
|
8362
8367
|
if (updateMapDimensions) {
|
|
8363
|
-
if (this.
|
|
8368
|
+
if (this.parentMap) {
|
|
8364
8369
|
if (this.enabled !== false) {
|
|
8365
|
-
this.
|
|
8370
|
+
this.parentMap.getListener().triggerEvent('ondimchange', 'time');
|
|
8366
8371
|
}
|
|
8367
8372
|
}
|
|
8368
8373
|
}
|
|
@@ -8389,43 +8394,41 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8389
8394
|
|
|
8390
8395
|
if (updateMapDimensions) {
|
|
8391
8396
|
if (dim.linked === true) {
|
|
8392
|
-
|
|
8393
|
-
this.
|
|
8397
|
+
if (this.parentMap) {
|
|
8398
|
+
this.parentMap.setDimension(name, dim.getValue());
|
|
8394
8399
|
}
|
|
8395
8400
|
}
|
|
8396
8401
|
}
|
|
8397
8402
|
}
|
|
8398
8403
|
}, {
|
|
8399
8404
|
key: "__parseGetCapForLayer",
|
|
8400
|
-
value: function __parseGetCapForLayer(
|
|
8405
|
+
value: function __parseGetCapForLayer(getcapabilitiesjson, layerDoneCallback, fail) {
|
|
8401
8406
|
var _this3 = this;
|
|
8402
8407
|
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
if (!jsondata) {
|
|
8408
|
+
if (!getcapabilitiesjson) {
|
|
8406
8409
|
this.title = I18n.service_has_error.text;
|
|
8407
8410
|
this["abstract"] = I18n.not_available_message.text;
|
|
8408
|
-
fail(
|
|
8411
|
+
fail(this, I18n.unable_to_connect_server.text);
|
|
8409
8412
|
return;
|
|
8410
8413
|
}
|
|
8411
8414
|
|
|
8412
|
-
var
|
|
8415
|
+
var wmjsService = WMGetServiceFromStore(this.service); // Get the capability object
|
|
8413
8416
|
|
|
8414
8417
|
var capabilityObject;
|
|
8415
8418
|
|
|
8416
8419
|
try {
|
|
8417
|
-
capabilityObject =
|
|
8420
|
+
capabilityObject = wmjsService.getCapabilityElement(getcapabilitiesjson);
|
|
8418
8421
|
} catch (_a) {
|
|
8419
|
-
fail(
|
|
8422
|
+
fail(this, 'No capability element in service');
|
|
8420
8423
|
return;
|
|
8421
8424
|
}
|
|
8422
8425
|
|
|
8423
|
-
this.version =
|
|
8426
|
+
this.version = wmjsService.version; // Get the rootLayer
|
|
8424
8427
|
|
|
8425
8428
|
var rootLayer = capabilityObject.Layer;
|
|
8426
8429
|
|
|
8427
8430
|
if (!isDefined(rootLayer)) {
|
|
8428
|
-
fail(
|
|
8431
|
+
fail(this, 'No Layer element in service');
|
|
8429
8432
|
return;
|
|
8430
8433
|
}
|
|
8431
8434
|
|
|
@@ -8497,10 +8500,9 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8497
8500
|
} // TODO Should be arranged also for the other services:
|
|
8498
8501
|
|
|
8499
8502
|
|
|
8500
|
-
_this3.getmapURL = WMJScheckURL(
|
|
8501
|
-
_this3.getfeatureinfoURL = WMJScheckURL(
|
|
8502
|
-
_this3.getlegendgraphicURL = WMJScheckURL(
|
|
8503
|
-
_this3.getCapabilitiesDoc = jsondata;
|
|
8503
|
+
_this3.getmapURL = WMJScheckURL(_this3.getmapURL);
|
|
8504
|
+
_this3.getfeatureinfoURL = WMJScheckURL(_this3.getfeatureinfoURL);
|
|
8505
|
+
_this3.getlegendgraphicURL = WMJScheckURL(_this3.getlegendgraphicURL);
|
|
8504
8506
|
_this3.title = jsonlayer.Title.value;
|
|
8505
8507
|
|
|
8506
8508
|
try {
|
|
@@ -8531,7 +8533,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8531
8533
|
// Fill in SRS and BBOX on basis of BoundingBox attribute
|
|
8532
8534
|
var gpbbox = toArray(data.BoundingBox);
|
|
8533
8535
|
|
|
8534
|
-
for (j = 0; j < gpbbox.length; j += 1) {
|
|
8536
|
+
for (var j = 0; j < gpbbox.length; j += 1) {
|
|
8535
8537
|
var srs = void 0;
|
|
8536
8538
|
srs = gpbbox[j].attr.SRS;
|
|
8537
8539
|
|
|
@@ -8559,8 +8561,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8559
8561
|
geoProperty.srs = srs;
|
|
8560
8562
|
var swapBBOX = false;
|
|
8561
8563
|
|
|
8562
|
-
if (
|
|
8563
|
-
if (geoProperty.srs === 'EPSG:4326' &&
|
|
8564
|
+
if (_this3.version === WMSVersion.version130) {
|
|
8565
|
+
if (geoProperty.srs === 'EPSG:4326' && _this3.wms130bboxcompatibilitymode === false) {
|
|
8564
8566
|
swapBBOX = true;
|
|
8565
8567
|
}
|
|
8566
8568
|
}
|
|
@@ -8588,7 +8590,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8588
8590
|
getgpbbox(jsonlayer);
|
|
8589
8591
|
getgpbbox(rootLayer); // Fill in SRS on basis of SRS attribute
|
|
8590
8592
|
|
|
8591
|
-
for (j = 0; j < gp.length; j += 1) {
|
|
8593
|
+
for (var j = 0; j < gp.length; j += 1) {
|
|
8592
8594
|
if (tempSRS.indexOf(gp[j].value) === -1) {
|
|
8593
8595
|
var geoProperty = new WMProjection();
|
|
8594
8596
|
debug(DebugType.Error, "Warning: BoundingBOX missing for SRS ".concat(gp[j].value));
|
|
@@ -8597,7 +8599,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8597
8599
|
geoProperty.bbox.right = 180;
|
|
8598
8600
|
geoProperty.bbox.top = 90;
|
|
8599
8601
|
geoProperty.srs = gp[j].value;
|
|
8600
|
-
|
|
8602
|
+
|
|
8603
|
+
_this3.projectionProperties.push(geoProperty);
|
|
8601
8604
|
}
|
|
8602
8605
|
}
|
|
8603
8606
|
|
|
@@ -8609,13 +8612,13 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8609
8612
|
try {
|
|
8610
8613
|
if (parseInt(jsonlayer.attr.queryable, 10) === 1) _this3.queryable = true;else _this3.queryable = false;
|
|
8611
8614
|
} catch (e) {
|
|
8612
|
-
debug(DebugType.Error, "Unable to detect whether this layer is queryable (for layer ".concat(
|
|
8615
|
+
debug(DebugType.Error, "Unable to detect whether this layer is queryable (for layer ".concat(_this3.title, ")"));
|
|
8613
8616
|
}
|
|
8614
8617
|
|
|
8615
8618
|
foundLayer = 1;
|
|
8616
8619
|
};
|
|
8617
8620
|
|
|
8618
|
-
function recursivelyFindLayer(JSONLayers, path, _prevNestedLayerPath) {
|
|
8621
|
+
function recursivelyFindLayer(thisLayer, JSONLayers, path, _prevNestedLayerPath) {
|
|
8619
8622
|
for (var k = 0; k < JSONLayers.length; k += 1) {
|
|
8620
8623
|
var _nestedLayerPath = [];
|
|
8621
8624
|
|
|
@@ -8634,9 +8637,9 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8634
8637
|
/* Do nothing */
|
|
8635
8638
|
}
|
|
8636
8639
|
|
|
8637
|
-
recursivelyFindLayer(toArray(JSONLayers[k].Layer), pathnew, _nestedLayerPath);
|
|
8640
|
+
recursivelyFindLayer(thisLayer, toArray(JSONLayers[k].Layer), pathnew, _nestedLayerPath);
|
|
8638
8641
|
} else if (JSONLayers[k].Name) {
|
|
8639
|
-
if (JSONLayers[k].Name.value ===
|
|
8642
|
+
if (JSONLayers[k].Name.value === thisLayer.name) {
|
|
8640
8643
|
foundLayerFunction(JSONLayers[k], path, _nestedLayerPath);
|
|
8641
8644
|
return;
|
|
8642
8645
|
}
|
|
@@ -8648,13 +8651,13 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8648
8651
|
var JSONLayers = toArray(rootLayer.Layer);
|
|
8649
8652
|
var path = '';
|
|
8650
8653
|
var nestedLayerPath = [rootLayer];
|
|
8651
|
-
recursivelyFindLayer(JSONLayers, path, nestedLayerPath);
|
|
8654
|
+
recursivelyFindLayer(this, JSONLayers, path, nestedLayerPath);
|
|
8652
8655
|
|
|
8653
8656
|
if (foundLayer === 0) {
|
|
8654
8657
|
// Layer was not found...
|
|
8655
8658
|
var message = '';
|
|
8656
8659
|
|
|
8657
|
-
if (
|
|
8660
|
+
if (this.name) {
|
|
8658
8661
|
message = "Unable to find layer '".concat(this.name, "' in service '").concat(this.service, "'");
|
|
8659
8662
|
} else {
|
|
8660
8663
|
message = "Unable to find layer '".concat(this.title, "' in service '").concat(this.service, "'");
|
|
@@ -8683,7 +8686,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8683
8686
|
|
|
8684
8687
|
}, {
|
|
8685
8688
|
key: "parseLayer",
|
|
8686
|
-
value: function parseLayer(_layerDoneCallback, forceReload
|
|
8689
|
+
value: function parseLayer(_layerDoneCallback, forceReload) {
|
|
8687
8690
|
var _this4 = this;
|
|
8688
8691
|
|
|
8689
8692
|
this.hasError = false;
|
|
@@ -8710,20 +8713,14 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8710
8713
|
};
|
|
8711
8714
|
|
|
8712
8715
|
var callback = function callback(data) {
|
|
8713
|
-
_this4.__parseGetCapForLayer(
|
|
8716
|
+
_this4.__parseGetCapForLayer(data, layerDoneCallback, fail);
|
|
8714
8717
|
};
|
|
8715
8718
|
|
|
8716
8719
|
var requestfail = function requestfail() {
|
|
8717
8720
|
fail(_this4, I18n.no_capability_element_found.text);
|
|
8718
8721
|
};
|
|
8719
8722
|
|
|
8720
|
-
var
|
|
8721
|
-
|
|
8722
|
-
if (!xml2jsonrequest) {
|
|
8723
|
-
newXml2jsonrequest = this.parentMaps && this.parentMaps.length > 0 ? this.parentMaps[0].xml2jsonrequest : undefined;
|
|
8724
|
-
}
|
|
8725
|
-
|
|
8726
|
-
this.WMJSService = WMGetServiceFromStore(this.service, newXml2jsonrequest);
|
|
8723
|
+
var wmjsService = WMGetServiceFromStore(this.service);
|
|
8727
8724
|
var options = {
|
|
8728
8725
|
headers: {}
|
|
8729
8726
|
};
|
|
@@ -8732,10 +8729,10 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8732
8729
|
options.headers = this.headers;
|
|
8733
8730
|
}
|
|
8734
8731
|
|
|
8735
|
-
if (
|
|
8736
|
-
|
|
8732
|
+
if (wmjsService.service !== undefined) {
|
|
8733
|
+
wmjsService.getCapabilities(function (data) {
|
|
8737
8734
|
callback(data);
|
|
8738
|
-
}, requestfail, forceReload,
|
|
8735
|
+
}, requestfail, forceReload, options);
|
|
8739
8736
|
}
|
|
8740
8737
|
}
|
|
8741
8738
|
/**
|
|
@@ -8811,7 +8808,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8811
8808
|
success(layerObjects[currentLayerIndex], currentLayerIndex, layerObjects.length);
|
|
8812
8809
|
};
|
|
8813
8810
|
|
|
8814
|
-
this.
|
|
8811
|
+
var wmjsService = WMGetServiceFromStore(this.service);
|
|
8812
|
+
wmjsService.getLayerObjectsFlat(getLayerObjectsFinished, failure, undefined);
|
|
8815
8813
|
}
|
|
8816
8814
|
}, {
|
|
8817
8815
|
key: "autoSelectLayer",
|
|
@@ -8829,7 +8827,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
8829
8827
|
}
|
|
8830
8828
|
};
|
|
8831
8829
|
|
|
8832
|
-
this.
|
|
8830
|
+
var wmjsService = WMGetServiceFromStore(this.service);
|
|
8831
|
+
wmjsService.getLayerObjectsFlat(getLayerObjectsFinished, failure, undefined);
|
|
8833
8832
|
}
|
|
8834
8833
|
}, {
|
|
8835
8834
|
key: "getNextLayer",
|
|
@@ -9005,8 +9004,8 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
9005
9004
|
value: function display(displayornot) {
|
|
9006
9005
|
this.enabled = displayornot;
|
|
9007
9006
|
|
|
9008
|
-
|
|
9009
|
-
this.
|
|
9007
|
+
if (this.parentMap) {
|
|
9008
|
+
this.parentMap.displayLayer(this, this.enabled);
|
|
9010
9009
|
}
|
|
9011
9010
|
}
|
|
9012
9011
|
}]);
|