@nextgis/ngw-map 1.6.0 → 1.8.2
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/ngw-map.cjs.js +5 -5
- package/lib/ngw-map.cjs.js.map +1 -1
- package/lib/ngw-map.cjs.prod.js +1 -1
- package/lib/ngw-map.cjs.prod.js.map +1 -1
- package/lib/ngw-map.esm-browser.js +152 -49
- package/lib/ngw-map.esm-browser.js.map +1 -1
- package/lib/ngw-map.esm-browser.prod.js +1 -1
- package/lib/ngw-map.esm-browser.prod.js.map +1 -1
- package/lib/ngw-map.esm-bundler.js +5 -5
- package/lib/ngw-map.esm-bundler.js.map +1 -1
- package/lib/ngw-map.esm-bundler.prod.js +1 -1
- package/lib/ngw-map.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-map.global.js +218 -76
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +9 -9
package/lib/ngw-map.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 1.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 1.8.2; author: NextGIS */
|
|
2
2
|
var NgwMap = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -2416,13 +2416,14 @@ var NgwMap = (function (exports) {
|
|
|
2416
2416
|
*/
|
|
2417
2417
|
WebMapLayers.prototype.fitLayer = function (layerDef, options) {
|
|
2418
2418
|
return __awaiter(this, void 0, void 0, function () {
|
|
2419
|
-
var layer, extent;
|
|
2419
|
+
var layer, getBounds, extent;
|
|
2420
2420
|
return __generator(this, function (_a) {
|
|
2421
2421
|
switch (_a.label) {
|
|
2422
2422
|
case 0:
|
|
2423
2423
|
layer = this.getLayer(layerDef);
|
|
2424
|
-
|
|
2425
|
-
return [
|
|
2424
|
+
getBounds = layer && (layer.getBounds || layer.getExtent);
|
|
2425
|
+
if (!getBounds) return [3 /*break*/, 2];
|
|
2426
|
+
return [4 /*yield*/, getBounds.call(layer)];
|
|
2426
2427
|
case 1:
|
|
2427
2428
|
extent = _a.sent();
|
|
2428
2429
|
if (extent) {
|
|
@@ -2546,7 +2547,7 @@ var NgwMap = (function (exports) {
|
|
|
2546
2547
|
var _a, _b;
|
|
2547
2548
|
if (options === void 0) { options = {}; }
|
|
2548
2549
|
return __awaiter(this, void 0, void 0, function () {
|
|
2549
|
-
var id, _order, adapterEngine, geoJsonOptions, _c, maxZoom, minZoom, visibility, modified, _adapter, layerId, layer, opacity, extent;
|
|
2550
|
+
var id, _order, adapterEngine, geoJsonOptions, _c, maxZoom, minZoom, visibility, modified, _adapter, layerId, layer, opacity, getBounds, extent;
|
|
2550
2551
|
return __generator(this, function (_d) {
|
|
2551
2552
|
switch (_d.label) {
|
|
2552
2553
|
case 0:
|
|
@@ -2649,8 +2650,9 @@ var NgwMap = (function (exports) {
|
|
|
2649
2650
|
if (opacity !== undefined && opacity <= 1) {
|
|
2650
2651
|
this.setLayerOpacity(_adapter, opacity);
|
|
2651
2652
|
}
|
|
2652
|
-
|
|
2653
|
-
return [
|
|
2653
|
+
getBounds = layer && (_adapter.getBounds || _adapter.getExtent);
|
|
2654
|
+
if (!(options.fit && getBounds)) return [3 /*break*/, 11];
|
|
2655
|
+
return [4 /*yield*/, getBounds.call(_adapter)];
|
|
2654
2656
|
case 9:
|
|
2655
2657
|
extent = _d.sent();
|
|
2656
2658
|
if (!extent) return [3 /*break*/, 11];
|
|
@@ -2838,7 +2840,7 @@ var NgwMap = (function (exports) {
|
|
|
2838
2840
|
var toStatus = status !== undefined ? status : !onMap;
|
|
2839
2841
|
var silent = options.silent !== undefined ? options.silent : false;
|
|
2840
2842
|
var action = function (l) { return __awaiter(_this, void 0, void 0, function () {
|
|
2841
|
-
var id, preEventName, eventName, order,
|
|
2843
|
+
var id, preEventName, eventName, order, anotherVisibleBaselayers, _i, anotherVisibleBaselayers_1, bl;
|
|
2842
2844
|
var _this = this;
|
|
2843
2845
|
return __generator(this, function (_a) {
|
|
2844
2846
|
switch (_a.label) {
|
|
@@ -2850,18 +2852,25 @@ var NgwMap = (function (exports) {
|
|
|
2850
2852
|
this._emitLayerEvent(preEventName, id, l);
|
|
2851
2853
|
this._emitLayerEvent('layer:pretoggle', id, l);
|
|
2852
2854
|
}
|
|
2853
|
-
if (!(toStatus && this.mapAdapter)) return [3 /*break*/,
|
|
2855
|
+
if (!(toStatus && this.mapAdapter)) return [3 /*break*/, 5];
|
|
2854
2856
|
order = l.options.baselayer ? 0 : l.options.order;
|
|
2855
|
-
if (!(l.options.baselayer && this._baselayers.length)) return [3 /*break*/,
|
|
2856
|
-
|
|
2857
|
+
if (!(l.options.baselayer && this._baselayers.length)) return [3 /*break*/, 4];
|
|
2858
|
+
anotherVisibleBaselayers = this._baselayers.filter(function (x) {
|
|
2857
2859
|
return x !== l.id && _this.isLayerVisible(x);
|
|
2858
2860
|
});
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
+
_i = 0, anotherVisibleBaselayers_1 = anotherVisibleBaselayers;
|
|
2862
|
+
_a.label = 1;
|
|
2861
2863
|
case 1:
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
+
if (!(_i < anotherVisibleBaselayers_1.length)) return [3 /*break*/, 4];
|
|
2865
|
+
bl = anotherVisibleBaselayers_1[_i];
|
|
2866
|
+
return [4 /*yield*/, this.hideLayer(bl)];
|
|
2864
2867
|
case 2:
|
|
2868
|
+
_a.sent();
|
|
2869
|
+
_a.label = 3;
|
|
2870
|
+
case 3:
|
|
2871
|
+
_i++;
|
|
2872
|
+
return [3 /*break*/, 1];
|
|
2873
|
+
case 4:
|
|
2865
2874
|
if (l.showLayer) {
|
|
2866
2875
|
l.showLayer.call(l, l.layer);
|
|
2867
2876
|
}
|
|
@@ -2871,16 +2880,16 @@ var NgwMap = (function (exports) {
|
|
|
2871
2880
|
if (order !== undefined) {
|
|
2872
2881
|
this.mapAdapter.setLayerOrder(l.layer, order, this._layers);
|
|
2873
2882
|
}
|
|
2874
|
-
return [3 /*break*/,
|
|
2875
|
-
case
|
|
2883
|
+
return [3 /*break*/, 6];
|
|
2884
|
+
case 5:
|
|
2876
2885
|
if (l.hideLayer) {
|
|
2877
2886
|
l.hideLayer.call(l, l.layer);
|
|
2878
2887
|
}
|
|
2879
2888
|
else if (l.layer !== undefined) {
|
|
2880
2889
|
this.mapAdapter.hideLayer(l.layer);
|
|
2881
2890
|
}
|
|
2882
|
-
_a.label =
|
|
2883
|
-
case
|
|
2891
|
+
_a.label = 6;
|
|
2892
|
+
case 6:
|
|
2884
2893
|
if (!silent) {
|
|
2885
2894
|
this._emitLayerEvent(eventName, id, l);
|
|
2886
2895
|
this._emitLayerEvent('layer:toggle', id, l);
|
|
@@ -2896,16 +2905,19 @@ var NgwMap = (function (exports) {
|
|
|
2896
2905
|
return Promise.resolve();
|
|
2897
2906
|
};
|
|
2898
2907
|
WebMapLayers.prototype.updateLayer = function (layerDef) {
|
|
2908
|
+
var _this = this;
|
|
2899
2909
|
var layer = this.getLayer(layerDef);
|
|
2900
2910
|
if (layer) {
|
|
2901
2911
|
if (layer.updateLayer) {
|
|
2902
|
-
layer.updateLayer();
|
|
2912
|
+
return Promise.resolve(layer.updateLayer());
|
|
2903
2913
|
}
|
|
2904
2914
|
else if (this.isLayerVisible(layer)) {
|
|
2905
|
-
this.hideLayer(layer, { silent: true })
|
|
2906
|
-
|
|
2915
|
+
return this.hideLayer(layer, { silent: true }).then(function () {
|
|
2916
|
+
return _this.showLayer(layer, { silent: true });
|
|
2917
|
+
});
|
|
2907
2918
|
}
|
|
2908
2919
|
}
|
|
2920
|
+
return Promise.resolve();
|
|
2909
2921
|
};
|
|
2910
2922
|
/**
|
|
2911
2923
|
* Set transparency for a given layer by number from 0 to 1
|
|
@@ -4861,6 +4873,18 @@ var NgwMap = (function (exports) {
|
|
|
4861
4873
|
}
|
|
4862
4874
|
});
|
|
4863
4875
|
}
|
|
4876
|
+
function fetchNgwLayerItemExtent(_a) {
|
|
4877
|
+
var resourceId = _a.resourceId, featureId = _a.featureId, connector = _a.connector, _b = _a.cache, cache = _b === void 0 ? true : _b;
|
|
4878
|
+
return connector
|
|
4879
|
+
.get('feature_layer.feature.item_extent', { cache: cache }, { id: resourceId, fid: featureId })
|
|
4880
|
+
.then(function (resp) {
|
|
4881
|
+
if (resp) {
|
|
4882
|
+
var _a = resp.extent, maxLat = _a.maxLat, maxLon = _a.maxLon, minLat = _a.minLat, minLon = _a.minLon;
|
|
4883
|
+
var extentArray = [minLon, minLat, maxLon, maxLat];
|
|
4884
|
+
return extentArray;
|
|
4885
|
+
}
|
|
4886
|
+
});
|
|
4887
|
+
}
|
|
4864
4888
|
function fetchNgwResourceExtent(item, connector) {
|
|
4865
4889
|
if (item.webmap) {
|
|
4866
4890
|
return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
|
|
@@ -4973,7 +4997,7 @@ var NgwMap = (function (exports) {
|
|
|
4973
4997
|
if (logic === 'any') {
|
|
4974
4998
|
filters_.forEach(function (f) {
|
|
4975
4999
|
if (checkIfPropertyFilter(f)) {
|
|
4976
|
-
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams), [createParam(f)]) })));
|
|
5000
|
+
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), [createParam(f)]) })));
|
|
4977
5001
|
}
|
|
4978
5002
|
else {
|
|
4979
5003
|
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: f }), _queries, __spreadArray([], _parentAllParams));
|
|
@@ -4995,11 +5019,11 @@ var NgwMap = (function (exports) {
|
|
|
4995
5019
|
if (propertiesFilterList.length) {
|
|
4996
5020
|
for (var _a = 0, propertiesFilterList_1 = propertiesFilterList; _a < propertiesFilterList_1.length; _a++) {
|
|
4997
5021
|
var x = propertiesFilterList_1[_a];
|
|
4998
|
-
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: x }), _queries, __spreadArray(__spreadArray([], _parentAllParams), filters_2));
|
|
5022
|
+
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: x }), _queries, __spreadArray(__spreadArray([], _parentAllParams, true), filters_2));
|
|
4999
5023
|
}
|
|
5000
5024
|
}
|
|
5001
5025
|
else {
|
|
5002
|
-
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams), filters_2) })));
|
|
5026
|
+
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), filters_2) })));
|
|
5003
5027
|
}
|
|
5004
5028
|
}
|
|
5005
5029
|
return CancelablePromise.all(_queries).then(function (itemsParts) {
|
|
@@ -5222,16 +5246,26 @@ var NgwMap = (function (exports) {
|
|
|
5222
5246
|
});
|
|
5223
5247
|
});
|
|
5224
5248
|
};
|
|
5249
|
+
/** @deprecated use {@link NgwGeoJsonAdapter.getBounds} instead */
|
|
5225
5250
|
NgwGeoJsonAdapter.prototype.getExtent = function () {
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5251
|
+
return this.getBounds();
|
|
5252
|
+
};
|
|
5253
|
+
NgwGeoJsonAdapter.prototype.getBounds = function () {
|
|
5254
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5255
|
+
var hasData;
|
|
5256
|
+
return __generator(this, function (_a) {
|
|
5257
|
+
hasData = this.getLayers && this.getLayers().length;
|
|
5258
|
+
if (this.options.strategy === 'BBOX' || hasData) {
|
|
5259
|
+
return [2 /*return*/, fetchNgwResourceExtent(item, connector)];
|
|
5260
|
+
}
|
|
5261
|
+
else {
|
|
5262
|
+
if (_super.prototype.getBounds) {
|
|
5263
|
+
return [2 /*return*/, _super.prototype.getBounds.call(this)];
|
|
5264
|
+
}
|
|
5265
|
+
}
|
|
5266
|
+
return [2 /*return*/];
|
|
5267
|
+
});
|
|
5268
|
+
});
|
|
5235
5269
|
};
|
|
5236
5270
|
NgwGeoJsonAdapter.prototype.beforeRemove = function () {
|
|
5237
5271
|
removed = true;
|
|
@@ -5772,6 +5806,9 @@ var NgwMap = (function (exports) {
|
|
|
5772
5806
|
BaseProperty.prototype.getParent = function () {
|
|
5773
5807
|
return this.item.tree.getParent();
|
|
5774
5808
|
};
|
|
5809
|
+
BaseProperty.prototype.getChildren = function () {
|
|
5810
|
+
return this.item.tree.getChildren();
|
|
5811
|
+
};
|
|
5775
5812
|
BaseProperty.prototype.isGroup = function () {
|
|
5776
5813
|
var children = this.item.tree.getDescendants();
|
|
5777
5814
|
return children.length;
|
|
@@ -5892,6 +5929,26 @@ var NgwMap = (function (exports) {
|
|
|
5892
5929
|
return property && property.get();
|
|
5893
5930
|
}));
|
|
5894
5931
|
};
|
|
5932
|
+
CheckProperty.prototype.block = function (options) {
|
|
5933
|
+
this._blocked = true;
|
|
5934
|
+
this._block(options);
|
|
5935
|
+
};
|
|
5936
|
+
CheckProperty.prototype.unBlock = function (options) {
|
|
5937
|
+
this._blocked = false;
|
|
5938
|
+
if (this.getValue()) {
|
|
5939
|
+
this._unBlock(options);
|
|
5940
|
+
}
|
|
5941
|
+
};
|
|
5942
|
+
CheckProperty.prototype.blockChild = function (options) {
|
|
5943
|
+
var _this = this;
|
|
5944
|
+
this.item.tree
|
|
5945
|
+
.getDescendants()
|
|
5946
|
+
.forEach(function (x) { return _this._blockChild(x, options); });
|
|
5947
|
+
};
|
|
5948
|
+
CheckProperty.prototype.unblockChild = function (options) {
|
|
5949
|
+
var _this = this;
|
|
5950
|
+
this.item.tree.getChildren().forEach(function (x) { return _this._unBlockChild(x, options); });
|
|
5951
|
+
};
|
|
5895
5952
|
CheckProperty.prototype._prepareValue = function (value) {
|
|
5896
5953
|
return value;
|
|
5897
5954
|
};
|
|
@@ -5913,32 +5970,12 @@ var NgwMap = (function (exports) {
|
|
|
5913
5970
|
this.unblockChild(options);
|
|
5914
5971
|
}
|
|
5915
5972
|
};
|
|
5916
|
-
CheckProperty.prototype.block = function (options) {
|
|
5917
|
-
this._blocked = true;
|
|
5918
|
-
this._block(options);
|
|
5919
|
-
};
|
|
5920
5973
|
CheckProperty.prototype._block = function (options) {
|
|
5921
5974
|
this._turnOff(options);
|
|
5922
5975
|
};
|
|
5923
|
-
CheckProperty.prototype.unBlock = function (options) {
|
|
5924
|
-
this._blocked = false;
|
|
5925
|
-
if (this.getValue()) {
|
|
5926
|
-
this._unBlock(options);
|
|
5927
|
-
}
|
|
5928
|
-
};
|
|
5929
5976
|
CheckProperty.prototype._unBlock = function (options) {
|
|
5930
5977
|
this._turnOn(options);
|
|
5931
5978
|
};
|
|
5932
|
-
CheckProperty.prototype.blockChild = function (options) {
|
|
5933
|
-
var _this = this;
|
|
5934
|
-
this.item.tree
|
|
5935
|
-
.getDescendants()
|
|
5936
|
-
.forEach(function (x) { return _this._blockChild(x, options); });
|
|
5937
|
-
};
|
|
5938
|
-
CheckProperty.prototype.unblockChild = function (options) {
|
|
5939
|
-
var _this = this;
|
|
5940
|
-
this.item.tree.getChildren().forEach(function (x) { return _this._unBlockChild(x, options); });
|
|
5941
|
-
};
|
|
5942
5979
|
CheckProperty.prototype._blockChild = function (item, options) {
|
|
5943
5980
|
var prop = item.properties &&
|
|
5944
5981
|
item.properties.property(this.name);
|
|
@@ -5994,22 +6031,22 @@ var NgwMap = (function (exports) {
|
|
|
5994
6031
|
};
|
|
5995
6032
|
ItemProperties.prototype._setPropertyHandler = function (propOpt) {
|
|
5996
6033
|
var handlers = ItemProperties.handlers;
|
|
5997
|
-
var
|
|
5998
|
-
if (!
|
|
6034
|
+
var Handler = propOpt.handler;
|
|
6035
|
+
if (!Handler && propOpt.type) {
|
|
5999
6036
|
switch (propOpt.type) {
|
|
6000
6037
|
case 'boolean':
|
|
6001
|
-
|
|
6038
|
+
Handler = handlers.CheckProperty;
|
|
6002
6039
|
break;
|
|
6003
6040
|
case 'string':
|
|
6004
|
-
|
|
6041
|
+
Handler = handlers.BaseProperty;
|
|
6005
6042
|
break;
|
|
6006
6043
|
default:
|
|
6007
|
-
|
|
6044
|
+
Handler = handlers.BaseProperty;
|
|
6008
6045
|
}
|
|
6009
6046
|
}
|
|
6010
|
-
if (
|
|
6047
|
+
if (Handler && propOpt.name) {
|
|
6011
6048
|
var options = __assign({}, (propOpt || {}));
|
|
6012
|
-
this._properties[propOpt.name] = new
|
|
6049
|
+
this._properties[propOpt.name] = new Handler(propOpt.name, this.item, options);
|
|
6013
6050
|
this._propertiesList.push(propOpt.name);
|
|
6014
6051
|
}
|
|
6015
6052
|
};
|
|
@@ -6068,6 +6105,62 @@ var NgwMap = (function (exports) {
|
|
|
6068
6105
|
return Item;
|
|
6069
6106
|
}());
|
|
6070
6107
|
|
|
6108
|
+
var WebmapLayerOpacityPropertyHandler = /** @class */ (function (_super) {
|
|
6109
|
+
__extends(WebmapLayerOpacityPropertyHandler, _super);
|
|
6110
|
+
function WebmapLayerOpacityPropertyHandler() {
|
|
6111
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6112
|
+
}
|
|
6113
|
+
WebmapLayerOpacityPropertyHandler.prototype.getProperty = function () {
|
|
6114
|
+
var layer = this.item.layer;
|
|
6115
|
+
if (layer) {
|
|
6116
|
+
return layer && layer.options && layer.options.opacity !== undefined
|
|
6117
|
+
? layer.options.opacity
|
|
6118
|
+
: 1;
|
|
6119
|
+
}
|
|
6120
|
+
return 1;
|
|
6121
|
+
};
|
|
6122
|
+
WebmapLayerOpacityPropertyHandler.prototype.update = function (value, options) {
|
|
6123
|
+
var _this = this;
|
|
6124
|
+
options = options || {};
|
|
6125
|
+
if (this.isGroup()) {
|
|
6126
|
+
this._value = this._prepareValue(value, options);
|
|
6127
|
+
var children = this.getChildren();
|
|
6128
|
+
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
|
|
6129
|
+
var child = children_1[_i];
|
|
6130
|
+
var property = child.properties.property(this.name);
|
|
6131
|
+
if (property) {
|
|
6132
|
+
if (options.propagation) {
|
|
6133
|
+
property.set(value, options);
|
|
6134
|
+
}
|
|
6135
|
+
else {
|
|
6136
|
+
property.update(property.get(), options);
|
|
6137
|
+
}
|
|
6138
|
+
}
|
|
6139
|
+
}
|
|
6140
|
+
}
|
|
6141
|
+
var layer = this.item.layer;
|
|
6142
|
+
if (layer) {
|
|
6143
|
+
var parents = this.getParents();
|
|
6144
|
+
var coef = parents.reduce(function (s, x) {
|
|
6145
|
+
var prop = x.properties.property(_this.name);
|
|
6146
|
+
var multiplier = prop ? prop.getValue() : 1;
|
|
6147
|
+
return s * multiplier;
|
|
6148
|
+
}, 1);
|
|
6149
|
+
var val = value * coef;
|
|
6150
|
+
this.item.webMap.setLayerOpacity(layer, this._prepareValue(val));
|
|
6151
|
+
}
|
|
6152
|
+
};
|
|
6153
|
+
WebmapLayerOpacityPropertyHandler.prototype._prepareValue = function (value, options) {
|
|
6154
|
+
if (options && options.propagation && this.isGroup()) {
|
|
6155
|
+
return 1;
|
|
6156
|
+
}
|
|
6157
|
+
// value = Number(value);
|
|
6158
|
+
// return value < 0.1 ? 0.1 : value;
|
|
6159
|
+
return Number(value);
|
|
6160
|
+
};
|
|
6161
|
+
return WebmapLayerOpacityPropertyHandler;
|
|
6162
|
+
}(BaseProperty));
|
|
6163
|
+
|
|
6071
6164
|
var NgwWebmapItem = /** @class */ (function (_super) {
|
|
6072
6165
|
__extends(NgwWebmapItem, _super);
|
|
6073
6166
|
function NgwWebmapItem(webMap, item, options, connector, parent, noInit) {
|
|
@@ -6162,6 +6255,9 @@ var NgwMap = (function (exports) {
|
|
|
6162
6255
|
NgwWebmapItem.prototype.fit = function () {
|
|
6163
6256
|
if (this.item.item_type === 'layer') ;
|
|
6164
6257
|
};
|
|
6258
|
+
NgwWebmapItem.prototype.getLayer = function () {
|
|
6259
|
+
return this.layer;
|
|
6260
|
+
};
|
|
6165
6261
|
NgwWebmapItem.prototype.getItemOptions = function (item) {
|
|
6166
6262
|
var transparency = item.item_type === 'layer' && item.layer_transparency;
|
|
6167
6263
|
var opacity = typeof transparency === 'number' ? (100 - transparency) / 100 : undefined;
|
|
@@ -6265,6 +6361,10 @@ var NgwMap = (function (exports) {
|
|
|
6265
6361
|
}
|
|
6266
6362
|
},
|
|
6267
6363
|
},
|
|
6364
|
+
{
|
|
6365
|
+
name: 'opacity',
|
|
6366
|
+
handler: WebmapLayerOpacityPropertyHandler,
|
|
6367
|
+
},
|
|
6268
6368
|
],
|
|
6269
6369
|
};
|
|
6270
6370
|
return NgwWebmapItem;
|
|
@@ -6493,16 +6593,40 @@ var NgwMap = (function (exports) {
|
|
|
6493
6593
|
delete this._webmapLayersIds;
|
|
6494
6594
|
};
|
|
6495
6595
|
NgwWebmapLayerAdapter.prototype.showLayer = function () {
|
|
6496
|
-
|
|
6497
|
-
this
|
|
6498
|
-
|
|
6596
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6597
|
+
return __generator(this, function (_a) {
|
|
6598
|
+
if (this.layer && this.layer.properties) {
|
|
6599
|
+
return [2 /*return*/, this.layer.properties.property('visibility').set(true)];
|
|
6600
|
+
}
|
|
6601
|
+
return [2 /*return*/];
|
|
6602
|
+
});
|
|
6603
|
+
});
|
|
6499
6604
|
};
|
|
6500
6605
|
NgwWebmapLayerAdapter.prototype.hideLayer = function () {
|
|
6501
|
-
|
|
6502
|
-
this
|
|
6503
|
-
|
|
6606
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6607
|
+
return __generator(this, function (_a) {
|
|
6608
|
+
if (this.layer && this.layer.properties) {
|
|
6609
|
+
return [2 /*return*/, this.layer.properties.property('visibility').set(false)];
|
|
6610
|
+
}
|
|
6611
|
+
return [2 /*return*/];
|
|
6612
|
+
});
|
|
6613
|
+
});
|
|
6504
6614
|
};
|
|
6615
|
+
NgwWebmapLayerAdapter.prototype.setOpacity = function (val) {
|
|
6616
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6617
|
+
return __generator(this, function (_a) {
|
|
6618
|
+
if (this.layer && this.layer.properties) {
|
|
6619
|
+
return [2 /*return*/, this.layer.properties.property('opacity').set(val)];
|
|
6620
|
+
}
|
|
6621
|
+
return [2 /*return*/];
|
|
6622
|
+
});
|
|
6623
|
+
});
|
|
6624
|
+
};
|
|
6625
|
+
/** @deprecated use {@link NgwWebmapLayerAdapter.getBounds} instead */
|
|
6505
6626
|
NgwWebmapLayerAdapter.prototype.getExtent = function () {
|
|
6627
|
+
return this.getBounds();
|
|
6628
|
+
};
|
|
6629
|
+
NgwWebmapLayerAdapter.prototype.getBounds = function () {
|
|
6506
6630
|
var webmap = this.response && this.response.webmap;
|
|
6507
6631
|
if (webmap) {
|
|
6508
6632
|
return getNgwWebmapExtent(webmap);
|
|
@@ -6782,7 +6906,15 @@ var NgwMap = (function (exports) {
|
|
|
6782
6906
|
var NgwResource = /** @class */ (function () {
|
|
6783
6907
|
function NgwResource() {
|
|
6784
6908
|
}
|
|
6909
|
+
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
6785
6910
|
NgwResource.prototype.getExtent = function () {
|
|
6911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6912
|
+
return __generator(this, function (_a) {
|
|
6913
|
+
return [2 /*return*/, this.getBounds()];
|
|
6914
|
+
});
|
|
6915
|
+
});
|
|
6916
|
+
};
|
|
6917
|
+
NgwResource.prototype.getBounds = function () {
|
|
6786
6918
|
return __awaiter(this, void 0, void 0, function () {
|
|
6787
6919
|
var _a;
|
|
6788
6920
|
return __generator(this, function (_b) {
|
|
@@ -6793,7 +6925,7 @@ var NgwMap = (function (exports) {
|
|
|
6793
6925
|
}
|
|
6794
6926
|
if (!this.item) return [3 /*break*/, 2];
|
|
6795
6927
|
_a = this;
|
|
6796
|
-
return [4 /*yield*/, fetchNgwResourceExtent(this.item, this.connector)
|
|
6928
|
+
return [4 /*yield*/, fetchNgwResourceExtent(this.item, this.connector)];
|
|
6797
6929
|
case 1:
|
|
6798
6930
|
_a._extent = _b.sent();
|
|
6799
6931
|
return [2 /*return*/, this._extent];
|
|
@@ -7300,11 +7432,11 @@ var NgwMap = (function (exports) {
|
|
|
7300
7432
|
function IdentifyItem(options) {
|
|
7301
7433
|
var f = options.feature;
|
|
7302
7434
|
this.id = f.id;
|
|
7435
|
+
this.geom = f.geom;
|
|
7303
7436
|
this.label = f.label;
|
|
7304
|
-
this.layerId = f.layerId;
|
|
7305
7437
|
this.parent = f.parent;
|
|
7306
7438
|
this.fields = f.fields;
|
|
7307
|
-
this.
|
|
7439
|
+
this.layerId = f.layerId;
|
|
7308
7440
|
this.connector = options.connector;
|
|
7309
7441
|
}
|
|
7310
7442
|
IdentifyItem.prototype.identify = function (options) {
|
|
@@ -7330,6 +7462,16 @@ var NgwMap = (function (exports) {
|
|
|
7330
7462
|
return _this._resource.feature_layer;
|
|
7331
7463
|
});
|
|
7332
7464
|
};
|
|
7465
|
+
IdentifyItem.prototype.getBounds = function () {
|
|
7466
|
+
if (this._extent) {
|
|
7467
|
+
return CancelablePromise.resolve(this._extent);
|
|
7468
|
+
}
|
|
7469
|
+
return fetchNgwLayerItemExtent({
|
|
7470
|
+
connector: this.connector,
|
|
7471
|
+
featureId: this.id,
|
|
7472
|
+
resourceId: this.layerId,
|
|
7473
|
+
});
|
|
7474
|
+
};
|
|
7333
7475
|
IdentifyItem.prototype.geojson = function () {
|
|
7334
7476
|
var _this = this;
|
|
7335
7477
|
if (this._geojson) {
|
|
@@ -7933,7 +8075,7 @@ var NgwMap = (function (exports) {
|
|
|
7933
8075
|
*/
|
|
7934
8076
|
NgwMap.prototype.fitLayer = function (layerDef, options) {
|
|
7935
8077
|
return __awaiter(this, void 0, void 0, function () {
|
|
7936
|
-
var id, ngwLayer,
|
|
8078
|
+
var id, ngwLayer, bounds, item, resourceId;
|
|
7937
8079
|
var _this = this;
|
|
7938
8080
|
return __generator(this, function (_a) {
|
|
7939
8081
|
switch (_a.label) {
|
|
@@ -7946,12 +8088,12 @@ var NgwMap = (function (exports) {
|
|
|
7946
8088
|
}
|
|
7947
8089
|
ngwLayer = id && this._ngwLayers[id];
|
|
7948
8090
|
if (!ngwLayer) return [3 /*break*/, 7];
|
|
7949
|
-
if (!ngwLayer.layer.
|
|
7950
|
-
return [4 /*yield*/, ngwLayer.layer.
|
|
8091
|
+
if (!ngwLayer.layer.getBounds) return [3 /*break*/, 2];
|
|
8092
|
+
return [4 /*yield*/, ngwLayer.layer.getBounds()];
|
|
7951
8093
|
case 1:
|
|
7952
|
-
|
|
7953
|
-
if (
|
|
7954
|
-
this.fitBounds(
|
|
8094
|
+
bounds = _a.sent();
|
|
8095
|
+
if (bounds) {
|
|
8096
|
+
this.fitBounds(bounds, options);
|
|
7955
8097
|
}
|
|
7956
8098
|
return [3 /*break*/, 6];
|
|
7957
8099
|
case 2:
|