@nextgis/ngw-leaflet 1.5.0 → 1.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/lib/index.d.ts +2 -1
- package/lib/ngw-leaflet.esm-browser.js +480 -313
- package/lib/ngw-leaflet.esm-browser.js.map +1 -0
- package/lib/ngw-leaflet.esm-browser.prod.js +3 -2
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -0
- package/lib/ngw-leaflet.esm-bundler.js +2 -1
- package/lib/ngw-leaflet.esm-bundler.js.map +1 -0
- package/lib/ngw-leaflet.esm-bundler.prod.js +1 -0
- package/lib/ngw-leaflet.esm-bundler.prod.js.map +1 -0
- package/lib/ngw-leaflet.global.js +589 -446
- package/lib/ngw-leaflet.global.js.map +1 -0
- package/lib/ngw-leaflet.global.prod.js +3 -2
- package/lib/ngw-leaflet.global.prod.js.map +1 -0
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-leaflet; version: 1.
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 1.8.0; author: NextGIS */
|
|
2
2
|
var NgwLeaflet = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -14862,7 +14862,6 @@ var NgwLeaflet = (function () {
|
|
|
14862
14862
|
*
|
|
14863
14863
|
* promise.cancel();
|
|
14864
14864
|
* ```
|
|
14865
|
-
* @public
|
|
14866
14865
|
*/
|
|
14867
14866
|
var CancelablePromise = /** @class */ (function () {
|
|
14868
14867
|
function CancelablePromise(executor, timeout) {
|
|
@@ -15174,8 +15173,7 @@ var NgwLeaflet = (function () {
|
|
|
15174
15173
|
}
|
|
15175
15174
|
|
|
15176
15175
|
/**
|
|
15177
|
-
*
|
|
15178
|
-
* @param ev @deprecated
|
|
15176
|
+
* @internal
|
|
15179
15177
|
*/
|
|
15180
15178
|
function deprecatedMapClick(ev) {
|
|
15181
15179
|
if (!ev.lngLat && ev.latLng) {
|
|
@@ -15187,6 +15185,7 @@ var NgwLeaflet = (function () {
|
|
|
15187
15185
|
return ev;
|
|
15188
15186
|
}
|
|
15189
15187
|
|
|
15188
|
+
/** @internal */
|
|
15190
15189
|
function deprecatedWarn(message) {
|
|
15191
15190
|
console.warn("DEPRECATED WARN: " + message);
|
|
15192
15191
|
}
|
|
@@ -15377,8 +15376,8 @@ var NgwLeaflet = (function () {
|
|
|
15377
15376
|
return newObj;
|
|
15378
15377
|
}
|
|
15379
15378
|
|
|
15380
|
-
function
|
|
15381
|
-
return
|
|
15379
|
+
function isObject$1(val) {
|
|
15380
|
+
return Object.prototype.toString.call(val) === '[object Object]';
|
|
15382
15381
|
}
|
|
15383
15382
|
|
|
15384
15383
|
function fixUrlStr(url) {
|
|
@@ -15386,13 +15385,6 @@ var NgwLeaflet = (function () {
|
|
|
15386
15385
|
return url.replace(/([^:]\/)\/+/g, '$1');
|
|
15387
15386
|
}
|
|
15388
15387
|
|
|
15389
|
-
/**
|
|
15390
|
-
* @module utils
|
|
15391
|
-
*/
|
|
15392
|
-
function isObject$1(val) {
|
|
15393
|
-
return Object.prototype.toString.call(val) === '[object Object]';
|
|
15394
|
-
}
|
|
15395
|
-
|
|
15396
15388
|
function isExpression(value) {
|
|
15397
15389
|
if (Array.isArray(value)) {
|
|
15398
15390
|
return true;
|
|
@@ -15481,6 +15473,9 @@ var NgwLeaflet = (function () {
|
|
|
15481
15473
|
return;
|
|
15482
15474
|
}
|
|
15483
15475
|
|
|
15476
|
+
function reEscape(s) {
|
|
15477
|
+
return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
15478
|
+
}
|
|
15484
15479
|
function like(b, a, iLike) {
|
|
15485
15480
|
a = String(a);
|
|
15486
15481
|
b = String(b);
|
|
@@ -15540,7 +15535,7 @@ var NgwLeaflet = (function () {
|
|
|
15540
15535
|
function propertiesFilter(properties, filters) {
|
|
15541
15536
|
var logic = typeof filters[0] === 'string' ? filters[0] : 'all';
|
|
15542
15537
|
var filterFunction = function (p) {
|
|
15543
|
-
if (
|
|
15538
|
+
if (isPropertyFilter(p)) {
|
|
15544
15539
|
var field_1 = p[0], operation = p[1], value_1 = p[2];
|
|
15545
15540
|
var operationExec = operationsAliases[operation];
|
|
15546
15541
|
if (operationExec) {
|
|
@@ -15940,7 +15935,7 @@ var NgwLeaflet = (function () {
|
|
|
15940
15935
|
var ID$2 = 0;
|
|
15941
15936
|
var OPTIONS$1 = {
|
|
15942
15937
|
minZoom: 0,
|
|
15943
|
-
maxZoom:
|
|
15938
|
+
maxZoom: 20,
|
|
15944
15939
|
paint: {
|
|
15945
15940
|
color: 'blue',
|
|
15946
15941
|
opacity: 0.4,
|
|
@@ -16111,7 +16106,7 @@ var NgwLeaflet = (function () {
|
|
|
16111
16106
|
};
|
|
16112
16107
|
/**
|
|
16113
16108
|
* Returns the map's geographical centerpoint.
|
|
16114
|
-
* @
|
|
16109
|
+
* @returns lngLat Array of two numbers representing longitude and latitude of the center of the map view.
|
|
16115
16110
|
*
|
|
16116
16111
|
* @example
|
|
16117
16112
|
* ```javascript
|
|
@@ -16144,7 +16139,7 @@ var NgwLeaflet = (function () {
|
|
|
16144
16139
|
};
|
|
16145
16140
|
/**
|
|
16146
16141
|
* Returns the map's current zoom level.
|
|
16147
|
-
* @
|
|
16142
|
+
* @returns The map's current zoom level (0-24).
|
|
16148
16143
|
*/
|
|
16149
16144
|
WebMapMain.prototype.getZoom = function () {
|
|
16150
16145
|
return this.mapAdapter.getZoom();
|
|
@@ -16512,13 +16507,14 @@ var NgwLeaflet = (function () {
|
|
|
16512
16507
|
*/
|
|
16513
16508
|
WebMapLayers.prototype.fitLayer = function (layerDef, options) {
|
|
16514
16509
|
return __awaiter(this, void 0, void 0, function () {
|
|
16515
|
-
var layer, extent;
|
|
16510
|
+
var layer, getBounds, extent;
|
|
16516
16511
|
return __generator(this, function (_a) {
|
|
16517
16512
|
switch (_a.label) {
|
|
16518
16513
|
case 0:
|
|
16519
16514
|
layer = this.getLayer(layerDef);
|
|
16520
|
-
|
|
16521
|
-
return [
|
|
16515
|
+
getBounds = layer && (layer.getBounds || layer.getExtent);
|
|
16516
|
+
if (!getBounds) return [3 /*break*/, 2];
|
|
16517
|
+
return [4 /*yield*/, getBounds.call(layer)];
|
|
16522
16518
|
case 1:
|
|
16523
16519
|
extent = _a.sent();
|
|
16524
16520
|
if (extent) {
|
|
@@ -16616,7 +16612,7 @@ var NgwLeaflet = (function () {
|
|
|
16616
16612
|
var layer;
|
|
16617
16613
|
return __generator(this, function (_a) {
|
|
16618
16614
|
switch (_a.label) {
|
|
16619
|
-
case 0: return [4 /*yield*/, this.addLayer(adapter, __assign(__assign({}, options), { baselayer: true }))];
|
|
16615
|
+
case 0: return [4 /*yield*/, this.addLayer(adapter, __assign(__assign({}, options), { baselayer: true }), undefined)];
|
|
16620
16616
|
case 1:
|
|
16621
16617
|
layer = _a.sent();
|
|
16622
16618
|
return [2 /*return*/, layer];
|
|
@@ -16642,12 +16638,12 @@ var NgwLeaflet = (function () {
|
|
|
16642
16638
|
var _a, _b;
|
|
16643
16639
|
if (options === void 0) { options = {}; }
|
|
16644
16640
|
return __awaiter(this, void 0, void 0, function () {
|
|
16645
|
-
var id, _order, adapterEngine, geoJsonOptions, _c, maxZoom, minZoom, visibility, modified, _adapter, layerId, layer, opacity, extent;
|
|
16641
|
+
var id, _order, adapterEngine, geoJsonOptions, _c, maxZoom, minZoom, visibility, modified, _adapter, layerId, layer, opacity, getBounds, extent;
|
|
16646
16642
|
return __generator(this, function (_d) {
|
|
16647
16643
|
switch (_d.label) {
|
|
16648
16644
|
case 0:
|
|
16649
16645
|
id = this._layersIdCounter++;
|
|
16650
|
-
_order = order
|
|
16646
|
+
_order = defined(order)
|
|
16651
16647
|
? order
|
|
16652
16648
|
: options.order !== undefined
|
|
16653
16649
|
? options.order
|
|
@@ -16745,8 +16741,9 @@ var NgwLeaflet = (function () {
|
|
|
16745
16741
|
if (opacity !== undefined && opacity <= 1) {
|
|
16746
16742
|
this.setLayerOpacity(_adapter, opacity);
|
|
16747
16743
|
}
|
|
16748
|
-
|
|
16749
|
-
return [
|
|
16744
|
+
getBounds = layer && (_adapter.getBounds || _adapter.getExtent);
|
|
16745
|
+
if (!(options.fit && getBounds)) return [3 /*break*/, 11];
|
|
16746
|
+
return [4 /*yield*/, getBounds.call(_adapter)];
|
|
16750
16747
|
case 9:
|
|
16751
16748
|
extent = _d.sent();
|
|
16752
16749
|
if (!extent) return [3 /*break*/, 11];
|
|
@@ -16886,11 +16883,19 @@ var NgwLeaflet = (function () {
|
|
|
16886
16883
|
opt.paint = opt.paint || {};
|
|
16887
16884
|
return this.addLayer(adapter || 'GEOJSON', opt);
|
|
16888
16885
|
};
|
|
16889
|
-
/** Shortcut for {@link WebMapLayers.addGeoJsonLayer} to
|
|
16886
|
+
/** Shortcut for {@link WebMapLayers.addGeoJsonLayer} to create GeoJson adapter with generic types for working in typescript */
|
|
16890
16887
|
WebMapLayers.prototype.addFeatureLayer = function (options) {
|
|
16891
16888
|
if (options === void 0) { options = {}; }
|
|
16892
16889
|
return this.addGeoJsonLayer(options);
|
|
16893
16890
|
};
|
|
16891
|
+
/** Shortcut for {@link WebMapLayers.addLayer} to create TileLayer adapter */
|
|
16892
|
+
WebMapLayers.prototype.addTileLayer = function (url, options) {
|
|
16893
|
+
return this.addLayer('TILE', __assign(__assign({}, options), { url: url }));
|
|
16894
|
+
};
|
|
16895
|
+
/** Shortcut for {@link WebMapLayers.addLayer} to create TileLayer adapter */
|
|
16896
|
+
WebMapLayers.prototype.addImageLayer = function (url, options) {
|
|
16897
|
+
return this.addLayer('IMAGE', __assign(__assign({}, options), { url: url }));
|
|
16898
|
+
};
|
|
16894
16899
|
/**
|
|
16895
16900
|
* Show added layer on the map by it definition.
|
|
16896
16901
|
*/
|
|
@@ -16925,49 +16930,66 @@ var NgwLeaflet = (function () {
|
|
|
16925
16930
|
var onMap = layer && layer.options.visibility;
|
|
16926
16931
|
var toStatus = status !== undefined ? status : !onMap;
|
|
16927
16932
|
var silent = options.silent !== undefined ? options.silent : false;
|
|
16928
|
-
var action = function (l) {
|
|
16929
|
-
var id
|
|
16930
|
-
var
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16933
|
+
var action = function (l) { return __awaiter(_this, void 0, void 0, function () {
|
|
16934
|
+
var id, preEventName, eventName, order, anotherVisibleBaselayers, _i, anotherVisibleBaselayers_1, bl;
|
|
16935
|
+
var _this = this;
|
|
16936
|
+
return __generator(this, function (_a) {
|
|
16937
|
+
switch (_a.label) {
|
|
16938
|
+
case 0:
|
|
16939
|
+
id = String(l.id);
|
|
16940
|
+
preEventName = toStatus ? 'layer:preshow' : 'layer:prehide';
|
|
16941
|
+
eventName = toStatus ? 'layer:show' : 'layer:hide';
|
|
16942
|
+
if (!silent) {
|
|
16943
|
+
this._emitLayerEvent(preEventName, id, l);
|
|
16944
|
+
this._emitLayerEvent('layer:pretoggle', id, l);
|
|
16945
|
+
}
|
|
16946
|
+
if (!(toStatus && this.mapAdapter)) return [3 /*break*/, 5];
|
|
16947
|
+
order = l.options.baselayer ? 0 : l.options.order;
|
|
16948
|
+
if (!(l.options.baselayer && this._baselayers.length)) return [3 /*break*/, 4];
|
|
16949
|
+
anotherVisibleBaselayers = this._baselayers.filter(function (x) {
|
|
16950
|
+
return x !== l.id && _this.isLayerVisible(x);
|
|
16951
|
+
});
|
|
16952
|
+
_i = 0, anotherVisibleBaselayers_1 = anotherVisibleBaselayers;
|
|
16953
|
+
_a.label = 1;
|
|
16954
|
+
case 1:
|
|
16955
|
+
if (!(_i < anotherVisibleBaselayers_1.length)) return [3 /*break*/, 4];
|
|
16956
|
+
bl = anotherVisibleBaselayers_1[_i];
|
|
16957
|
+
return [4 /*yield*/, this.hideLayer(bl)];
|
|
16958
|
+
case 2:
|
|
16959
|
+
_a.sent();
|
|
16960
|
+
_a.label = 3;
|
|
16961
|
+
case 3:
|
|
16962
|
+
_i++;
|
|
16963
|
+
return [3 /*break*/, 1];
|
|
16964
|
+
case 4:
|
|
16965
|
+
if (l.showLayer) {
|
|
16966
|
+
l.showLayer.call(l, l.layer);
|
|
16967
|
+
}
|
|
16968
|
+
else if (l.layer !== undefined) {
|
|
16969
|
+
this.mapAdapter.showLayer(l.layer);
|
|
16970
|
+
}
|
|
16971
|
+
if (order !== undefined) {
|
|
16972
|
+
this.mapAdapter.setLayerOrder(l.layer, order, this._layers);
|
|
16973
|
+
}
|
|
16974
|
+
return [3 /*break*/, 6];
|
|
16975
|
+
case 5:
|
|
16976
|
+
if (l.hideLayer) {
|
|
16977
|
+
l.hideLayer.call(l, l.layer);
|
|
16978
|
+
}
|
|
16979
|
+
else if (l.layer !== undefined) {
|
|
16980
|
+
this.mapAdapter.hideLayer(l.layer);
|
|
16981
|
+
}
|
|
16982
|
+
_a.label = 6;
|
|
16983
|
+
case 6:
|
|
16984
|
+
if (!silent) {
|
|
16985
|
+
this._emitLayerEvent(eventName, id, l);
|
|
16986
|
+
this._emitLayerEvent('layer:toggle', id, l);
|
|
16987
|
+
}
|
|
16988
|
+
l.options.visibility = toStatus;
|
|
16989
|
+
return [2 /*return*/];
|
|
16963
16990
|
}
|
|
16964
|
-
}
|
|
16965
|
-
|
|
16966
|
-
_this._emitLayerEvent(eventName, id, l);
|
|
16967
|
-
_this._emitLayerEvent('layer:toggle', id, l);
|
|
16968
|
-
}
|
|
16969
|
-
l.options.visibility = toStatus;
|
|
16970
|
-
};
|
|
16991
|
+
});
|
|
16992
|
+
}); };
|
|
16971
16993
|
if (layer && layer.options.visibility !== toStatus) {
|
|
16972
16994
|
return this.onMapLoad().then(function () { return action(layer); });
|
|
16973
16995
|
}
|
|
@@ -17392,7 +17414,6 @@ var NgwLeaflet = (function () {
|
|
|
17392
17414
|
|
|
17393
17415
|
/**
|
|
17394
17416
|
* Collection of methods for managing map controls
|
|
17395
|
-
* @public
|
|
17396
17417
|
*/
|
|
17397
17418
|
var WebMapControls = /** @class */ (function (_super) {
|
|
17398
17419
|
__extends(WebMapControls, _super);
|
|
@@ -17506,7 +17527,6 @@ var NgwLeaflet = (function () {
|
|
|
17506
17527
|
* webMap.addControl(toggleControl, 'top-right');
|
|
17507
17528
|
* ```
|
|
17508
17529
|
* {@link http://code.nextgis.com/demo-examples-toggle-control | Toggle button control example}
|
|
17509
|
-
* @public
|
|
17510
17530
|
*/
|
|
17511
17531
|
WebMapControls.prototype.createToggleControl = function (options) {
|
|
17512
17532
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -17532,7 +17552,6 @@ var NgwLeaflet = (function () {
|
|
|
17532
17552
|
*
|
|
17533
17553
|
* @param control - Instance of WEB-GIS framework control.
|
|
17534
17554
|
* What is returned by the {@Link WebMapControls.createControl | create} method
|
|
17535
|
-
* @public
|
|
17536
17555
|
*/
|
|
17537
17556
|
WebMapControls.prototype.removeControl = function (control) {
|
|
17538
17557
|
var _this = this;
|
|
@@ -17550,7 +17569,6 @@ var NgwLeaflet = (function () {
|
|
|
17550
17569
|
* Get instance of registered control
|
|
17551
17570
|
* @param control - Any registered control string name
|
|
17552
17571
|
* @param options - Custom control options
|
|
17553
|
-
* @public
|
|
17554
17572
|
*/
|
|
17555
17573
|
WebMapControls.prototype.getControl = function (control, options) {
|
|
17556
17574
|
var engine = this.mapAdapter.controlAdapters[control];
|
|
@@ -17690,7 +17708,6 @@ var NgwLeaflet = (function () {
|
|
|
17690
17708
|
* @typeParam C - Control
|
|
17691
17709
|
* @typeParam E - Events
|
|
17692
17710
|
*
|
|
17693
|
-
* @public
|
|
17694
17711
|
*/
|
|
17695
17712
|
var WebMap = /** @class */ (function (_super) {
|
|
17696
17713
|
__extends(WebMap, _super);
|
|
@@ -17709,82 +17726,75 @@ var NgwLeaflet = (function () {
|
|
|
17709
17726
|
WebMap.prototype._addLayerProviders = function () {
|
|
17710
17727
|
var e_1, _a, e_2, _b;
|
|
17711
17728
|
return __awaiter(this, void 0, void 0, function () {
|
|
17712
|
-
var _c, _d, kit, adapters, adapters_1, adapters_1_1, adapter, newAdapter, e_2_1, e_1_1
|
|
17729
|
+
var _c, _d, kit, adapters, adapters_1, adapters_1_1, adapter, newAdapter, e_2_1, e_1_1;
|
|
17713
17730
|
return __generator(this, function (_e) {
|
|
17714
17731
|
switch (_e.label) {
|
|
17715
17732
|
case 0:
|
|
17716
|
-
_e.trys.push([0,
|
|
17717
|
-
_e.label = 1;
|
|
17718
|
-
case 1:
|
|
17719
|
-
_e.trys.push([1, 19, 20, 25]);
|
|
17733
|
+
_e.trys.push([0, 18, 19, 24]);
|
|
17720
17734
|
_c = __asyncValues(this._starterKits);
|
|
17721
|
-
_e.label =
|
|
17722
|
-
case
|
|
17723
|
-
case
|
|
17724
|
-
if (!(_d = _e.sent(), !_d.done)) return [3 /*break*/,
|
|
17735
|
+
_e.label = 1;
|
|
17736
|
+
case 1: return [4 /*yield*/, _c.next()];
|
|
17737
|
+
case 2:
|
|
17738
|
+
if (!(_d = _e.sent(), !_d.done)) return [3 /*break*/, 17];
|
|
17725
17739
|
kit = _d.value;
|
|
17726
|
-
if (!kit.getLayerAdapters) return [3 /*break*/,
|
|
17740
|
+
if (!kit.getLayerAdapters) return [3 /*break*/, 16];
|
|
17727
17741
|
return [4 /*yield*/, kit.getLayerAdapters.call(kit)];
|
|
17728
|
-
case
|
|
17742
|
+
case 3:
|
|
17729
17743
|
adapters = _e.sent();
|
|
17730
|
-
if (!adapters) return [3 /*break*/,
|
|
17731
|
-
_e.label =
|
|
17732
|
-
case
|
|
17733
|
-
_e.trys.push([
|
|
17744
|
+
if (!adapters) return [3 /*break*/, 16];
|
|
17745
|
+
_e.label = 4;
|
|
17746
|
+
case 4:
|
|
17747
|
+
_e.trys.push([4, 10, 11, 16]);
|
|
17734
17748
|
adapters_1 = (e_2 = void 0, __asyncValues(adapters));
|
|
17735
|
-
_e.label =
|
|
17736
|
-
case
|
|
17737
|
-
case
|
|
17738
|
-
if (!(adapters_1_1 = _e.sent(), !adapters_1_1.done)) return [3 /*break*/,
|
|
17749
|
+
_e.label = 5;
|
|
17750
|
+
case 5: return [4 /*yield*/, adapters_1.next()];
|
|
17751
|
+
case 6:
|
|
17752
|
+
if (!(adapters_1_1 = _e.sent(), !adapters_1_1.done)) return [3 /*break*/, 9];
|
|
17739
17753
|
adapter = adapters_1_1.value;
|
|
17740
17754
|
return [4 /*yield*/, adapter.createAdapter(this)];
|
|
17741
|
-
case
|
|
17755
|
+
case 7:
|
|
17742
17756
|
newAdapter = _e.sent();
|
|
17743
17757
|
if (newAdapter) {
|
|
17744
17758
|
this.mapAdapter.layerAdapters[adapter.name] = newAdapter;
|
|
17745
17759
|
}
|
|
17746
|
-
_e.label =
|
|
17747
|
-
case
|
|
17748
|
-
case
|
|
17749
|
-
case
|
|
17760
|
+
_e.label = 8;
|
|
17761
|
+
case 8: return [3 /*break*/, 5];
|
|
17762
|
+
case 9: return [3 /*break*/, 16];
|
|
17763
|
+
case 10:
|
|
17750
17764
|
e_2_1 = _e.sent();
|
|
17751
17765
|
e_2 = { error: e_2_1 };
|
|
17752
|
-
return [3 /*break*/,
|
|
17753
|
-
case
|
|
17754
|
-
_e.trys.push([
|
|
17755
|
-
if (!(adapters_1_1 && !adapters_1_1.done && (_b = adapters_1.return))) return [3 /*break*/,
|
|
17766
|
+
return [3 /*break*/, 16];
|
|
17767
|
+
case 11:
|
|
17768
|
+
_e.trys.push([11, , 14, 15]);
|
|
17769
|
+
if (!(adapters_1_1 && !adapters_1_1.done && (_b = adapters_1.return))) return [3 /*break*/, 13];
|
|
17756
17770
|
return [4 /*yield*/, _b.call(adapters_1)];
|
|
17757
|
-
case
|
|
17771
|
+
case 12:
|
|
17758
17772
|
_e.sent();
|
|
17759
|
-
_e.label =
|
|
17760
|
-
case
|
|
17761
|
-
case
|
|
17773
|
+
_e.label = 13;
|
|
17774
|
+
case 13: return [3 /*break*/, 15];
|
|
17775
|
+
case 14:
|
|
17762
17776
|
if (e_2) throw e_2.error;
|
|
17763
17777
|
return [7 /*endfinally*/];
|
|
17764
|
-
case
|
|
17765
|
-
case
|
|
17766
|
-
case
|
|
17767
|
-
case
|
|
17778
|
+
case 15: return [7 /*endfinally*/];
|
|
17779
|
+
case 16: return [3 /*break*/, 1];
|
|
17780
|
+
case 17: return [3 /*break*/, 24];
|
|
17781
|
+
case 18:
|
|
17768
17782
|
e_1_1 = _e.sent();
|
|
17769
17783
|
e_1 = { error: e_1_1 };
|
|
17770
|
-
return [3 /*break*/,
|
|
17771
|
-
case
|
|
17772
|
-
_e.trys.push([
|
|
17773
|
-
if (!(_d && !_d.done && (_a = _c.return))) return [3 /*break*/,
|
|
17784
|
+
return [3 /*break*/, 24];
|
|
17785
|
+
case 19:
|
|
17786
|
+
_e.trys.push([19, , 22, 23]);
|
|
17787
|
+
if (!(_d && !_d.done && (_a = _c.return))) return [3 /*break*/, 21];
|
|
17774
17788
|
return [4 /*yield*/, _a.call(_c)];
|
|
17775
|
-
case
|
|
17789
|
+
case 20:
|
|
17776
17790
|
_e.sent();
|
|
17777
|
-
_e.label =
|
|
17778
|
-
case
|
|
17779
|
-
case
|
|
17791
|
+
_e.label = 21;
|
|
17792
|
+
case 21: return [3 /*break*/, 23];
|
|
17793
|
+
case 22:
|
|
17780
17794
|
if (e_1) throw e_1.error;
|
|
17781
17795
|
return [7 /*endfinally*/];
|
|
17782
|
-
case
|
|
17783
|
-
case
|
|
17784
|
-
case 26:
|
|
17785
|
-
er_1 = _e.sent();
|
|
17786
|
-
throw new Error(er_1);
|
|
17787
|
-
case 27: return [2 /*return*/];
|
|
17796
|
+
case 23: return [7 /*endfinally*/];
|
|
17797
|
+
case 24: return [2 /*return*/];
|
|
17788
17798
|
}
|
|
17789
17799
|
});
|
|
17790
17800
|
});
|
|
@@ -17795,7 +17805,7 @@ var NgwLeaflet = (function () {
|
|
|
17795
17805
|
WebMap.prototype._onLoadSync = function () {
|
|
17796
17806
|
var e_3, _a;
|
|
17797
17807
|
return __awaiter(this, void 0, void 0, function () {
|
|
17798
|
-
var _b, _c, kit,
|
|
17808
|
+
var _b, _c, kit, er_1, e_3_1;
|
|
17799
17809
|
return __generator(this, function (_d) {
|
|
17800
17810
|
switch (_d.label) {
|
|
17801
17811
|
case 0:
|
|
@@ -17815,8 +17825,8 @@ var NgwLeaflet = (function () {
|
|
|
17815
17825
|
_d.sent();
|
|
17816
17826
|
return [3 /*break*/, 6];
|
|
17817
17827
|
case 5:
|
|
17818
|
-
|
|
17819
|
-
console.error(
|
|
17828
|
+
er_1 = _d.sent();
|
|
17829
|
+
console.error(er_1);
|
|
17820
17830
|
return [3 /*break*/, 6];
|
|
17821
17831
|
case 6: return [3 /*break*/, 1];
|
|
17822
17832
|
case 7: return [3 /*break*/, 14];
|
|
@@ -18893,6 +18903,68 @@ var NgwLeaflet = (function () {
|
|
|
18893
18903
|
return filterOptions;
|
|
18894
18904
|
}
|
|
18895
18905
|
|
|
18906
|
+
function getNgwWebmapExtent(webmap) {
|
|
18907
|
+
var bottom = webmap['extent_bottom'];
|
|
18908
|
+
var left = webmap['extent_left'];
|
|
18909
|
+
var top = webmap['extent_top'];
|
|
18910
|
+
var right = webmap['extent_right'];
|
|
18911
|
+
if (bottom && left && top && right) {
|
|
18912
|
+
var extent = [left, bottom, right, top];
|
|
18913
|
+
if (extent[3] > 82) {
|
|
18914
|
+
extent[3] = 82;
|
|
18915
|
+
}
|
|
18916
|
+
if (extent[1] < -82) {
|
|
18917
|
+
extent[1] = -82;
|
|
18918
|
+
}
|
|
18919
|
+
return extent;
|
|
18920
|
+
}
|
|
18921
|
+
}
|
|
18922
|
+
function fetchNgwLayerExtent(_a) {
|
|
18923
|
+
var resourceId = _a.resourceId, connector = _a.connector, _b = _a.cache, cache = _b === void 0 ? true : _b;
|
|
18924
|
+
return connector
|
|
18925
|
+
.get('layer.extent', { cache: cache }, { id: resourceId })
|
|
18926
|
+
.then(function (resp) {
|
|
18927
|
+
if (resp) {
|
|
18928
|
+
var _a = resp.extent, maxLat = _a.maxLat, maxLon = _a.maxLon, minLat = _a.minLat, minLon = _a.minLon;
|
|
18929
|
+
var extentArray = [minLon, minLat, maxLon, maxLat];
|
|
18930
|
+
return extentArray;
|
|
18931
|
+
}
|
|
18932
|
+
});
|
|
18933
|
+
}
|
|
18934
|
+
function fetchNgwLayerItemExtent(_a) {
|
|
18935
|
+
var resourceId = _a.resourceId, featureId = _a.featureId, connector = _a.connector, _b = _a.cache, cache = _b === void 0 ? true : _b;
|
|
18936
|
+
return connector
|
|
18937
|
+
.get('feature_layer.feature.item_extent', { cache: cache }, { id: resourceId, fid: featureId })
|
|
18938
|
+
.then(function (resp) {
|
|
18939
|
+
if (resp) {
|
|
18940
|
+
var _a = resp.extent, maxLat = _a.maxLat, maxLon = _a.maxLon, minLat = _a.minLat, minLon = _a.minLon;
|
|
18941
|
+
var extentArray = [minLon, minLat, maxLon, maxLat];
|
|
18942
|
+
return extentArray;
|
|
18943
|
+
}
|
|
18944
|
+
});
|
|
18945
|
+
}
|
|
18946
|
+
function fetchNgwResourceExtent(item, connector) {
|
|
18947
|
+
if (item.webmap) {
|
|
18948
|
+
return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
|
|
18949
|
+
}
|
|
18950
|
+
else {
|
|
18951
|
+
var resource = item.resource;
|
|
18952
|
+
if (resource.cls && resource.cls.indexOf('style') !== -1) {
|
|
18953
|
+
return connector.getResource(resource.parent.id).then(function (res) {
|
|
18954
|
+
if (res) {
|
|
18955
|
+
return fetchNgwLayerExtent({
|
|
18956
|
+
resourceId: res.resource.id,
|
|
18957
|
+
connector: connector,
|
|
18958
|
+
});
|
|
18959
|
+
}
|
|
18960
|
+
});
|
|
18961
|
+
}
|
|
18962
|
+
else {
|
|
18963
|
+
return fetchNgwLayerExtent({ resourceId: resource.id, connector: connector });
|
|
18964
|
+
}
|
|
18965
|
+
}
|
|
18966
|
+
}
|
|
18967
|
+
|
|
18896
18968
|
function resourceIdFromLayerOptions(options, connector) {
|
|
18897
18969
|
return __awaiter(this, void 0, void 0, function () {
|
|
18898
18970
|
var resource, item, keyname, resourceId, resourceItem;
|
|
@@ -18983,7 +19055,7 @@ var NgwLeaflet = (function () {
|
|
|
18983
19055
|
if (logic === 'any') {
|
|
18984
19056
|
filters_.forEach(function (f) {
|
|
18985
19057
|
if (checkIfPropertyFilter(f)) {
|
|
18986
|
-
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams), [createParam(f)]) })));
|
|
19058
|
+
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), [createParam(f)]) })));
|
|
18987
19059
|
}
|
|
18988
19060
|
else {
|
|
18989
19061
|
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: f }), _queries, __spreadArray([], _parentAllParams));
|
|
@@ -19005,11 +19077,11 @@ var NgwLeaflet = (function () {
|
|
|
19005
19077
|
if (propertiesFilterList.length) {
|
|
19006
19078
|
for (var _a = 0, propertiesFilterList_1 = propertiesFilterList; _a < propertiesFilterList_1.length; _a++) {
|
|
19007
19079
|
var x = propertiesFilterList_1[_a];
|
|
19008
|
-
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: x }), _queries, __spreadArray(__spreadArray([], _parentAllParams), filters_2));
|
|
19080
|
+
createFeatureFieldFilterQueries(__assign(__assign({}, opt), { filters: x }), _queries, __spreadArray(__spreadArray([], _parentAllParams, true), filters_2));
|
|
19009
19081
|
}
|
|
19010
19082
|
}
|
|
19011
19083
|
else {
|
|
19012
|
-
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams), filters_2) })));
|
|
19084
|
+
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), filters_2) })));
|
|
19013
19085
|
}
|
|
19014
19086
|
}
|
|
19015
19087
|
return CancelablePromise.all(_queries).then(function (itemsParts) {
|
|
@@ -19131,56 +19203,6 @@ var NgwLeaflet = (function () {
|
|
|
19131
19203
|
});
|
|
19132
19204
|
}
|
|
19133
19205
|
|
|
19134
|
-
function getNgwWebmapExtent(webmap) {
|
|
19135
|
-
var bottom = webmap['extent_bottom'];
|
|
19136
|
-
var left = webmap['extent_left'];
|
|
19137
|
-
var top = webmap['extent_top'];
|
|
19138
|
-
var right = webmap['extent_right'];
|
|
19139
|
-
if (bottom && left && top && right) {
|
|
19140
|
-
var extent = [left, bottom, right, top];
|
|
19141
|
-
if (extent[3] > 82) {
|
|
19142
|
-
extent[3] = 82;
|
|
19143
|
-
}
|
|
19144
|
-
if (extent[1] < -82) {
|
|
19145
|
-
extent[1] = -82;
|
|
19146
|
-
}
|
|
19147
|
-
return extent;
|
|
19148
|
-
}
|
|
19149
|
-
}
|
|
19150
|
-
function fetchNgwLayerExtent(_a) {
|
|
19151
|
-
var resourceId = _a.resourceId, connector = _a.connector, _b = _a.cache, cache = _b === void 0 ? true : _b;
|
|
19152
|
-
return connector
|
|
19153
|
-
.get('layer.extent', { cache: cache }, { id: resourceId })
|
|
19154
|
-
.then(function (resp) {
|
|
19155
|
-
if (resp) {
|
|
19156
|
-
var _a = resp.extent, maxLat = _a.maxLat, maxLon = _a.maxLon, minLat = _a.minLat, minLon = _a.minLon;
|
|
19157
|
-
var extentArray = [minLon, minLat, maxLon, maxLat];
|
|
19158
|
-
return extentArray;
|
|
19159
|
-
}
|
|
19160
|
-
});
|
|
19161
|
-
}
|
|
19162
|
-
function fetchNgwResourceExtent(item, connector) {
|
|
19163
|
-
if (item.webmap) {
|
|
19164
|
-
return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
|
|
19165
|
-
}
|
|
19166
|
-
else {
|
|
19167
|
-
var resource = item.resource;
|
|
19168
|
-
if (resource.cls && resource.cls.indexOf('style') !== -1) {
|
|
19169
|
-
return connector.getResource(resource.parent.id).then(function (res) {
|
|
19170
|
-
if (res) {
|
|
19171
|
-
return fetchNgwLayerExtent({
|
|
19172
|
-
resourceId: res.resource.id,
|
|
19173
|
-
connector: connector,
|
|
19174
|
-
});
|
|
19175
|
-
}
|
|
19176
|
-
});
|
|
19177
|
-
}
|
|
19178
|
-
else {
|
|
19179
|
-
return fetchNgwLayerExtent({ resourceId: resource.id, connector: connector });
|
|
19180
|
-
}
|
|
19181
|
-
}
|
|
19182
|
-
}
|
|
19183
|
-
|
|
19184
19206
|
function createGeoJsonAdapter(props) {
|
|
19185
19207
|
var _a, _b;
|
|
19186
19208
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -19282,16 +19304,26 @@ var NgwLeaflet = (function () {
|
|
|
19282
19304
|
});
|
|
19283
19305
|
});
|
|
19284
19306
|
};
|
|
19307
|
+
/** @deprecated use {@link NgwGeoJsonAdapter.getBounds} instead */
|
|
19285
19308
|
NgwGeoJsonAdapter.prototype.getExtent = function () {
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19309
|
+
return this.getBounds();
|
|
19310
|
+
};
|
|
19311
|
+
NgwGeoJsonAdapter.prototype.getBounds = function () {
|
|
19312
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19313
|
+
var hasData;
|
|
19314
|
+
return __generator(this, function (_a) {
|
|
19315
|
+
hasData = this.getLayers && this.getLayers().length;
|
|
19316
|
+
if (this.options.strategy === 'BBOX' || hasData) {
|
|
19317
|
+
return [2 /*return*/, fetchNgwResourceExtent(item, connector)];
|
|
19318
|
+
}
|
|
19319
|
+
else {
|
|
19320
|
+
if (_super.prototype.getBounds) {
|
|
19321
|
+
return [2 /*return*/, _super.prototype.getBounds.call(this)];
|
|
19322
|
+
}
|
|
19323
|
+
}
|
|
19324
|
+
return [2 /*return*/];
|
|
19325
|
+
});
|
|
19326
|
+
});
|
|
19295
19327
|
};
|
|
19296
19328
|
NgwGeoJsonAdapter.prototype.beforeRemove = function () {
|
|
19297
19329
|
removed = true;
|
|
@@ -19354,7 +19386,7 @@ var NgwLeaflet = (function () {
|
|
|
19354
19386
|
return [3 /*break*/, 8];
|
|
19355
19387
|
case 7:
|
|
19356
19388
|
er_1 = _a.sent();
|
|
19357
|
-
if (er_1.name !== 'CancelError') {
|
|
19389
|
+
if (er_1 instanceof Error && er_1.name !== 'CancelError') {
|
|
19358
19390
|
throw er_1;
|
|
19359
19391
|
}
|
|
19360
19392
|
return [3 /*break*/, 8];
|
|
@@ -19458,10 +19490,11 @@ var NgwLeaflet = (function () {
|
|
|
19458
19490
|
});
|
|
19459
19491
|
}
|
|
19460
19492
|
|
|
19461
|
-
function
|
|
19493
|
+
function ngwApiToAdapterOptions(_a) {
|
|
19494
|
+
var options = _a.options, webMap = _a.webMap, baseUrl = _a.baseUrl;
|
|
19462
19495
|
var adapter = options.adapter || 'IMAGE';
|
|
19463
19496
|
var url;
|
|
19464
|
-
var layerAdapters = webMap.getLayerAdapters();
|
|
19497
|
+
var layerAdapters = webMap && webMap.getLayerAdapters();
|
|
19465
19498
|
var isImageAllowed = layerAdapters ? layerAdapters.IMAGE : true;
|
|
19466
19499
|
var resourceId = options.resource;
|
|
19467
19500
|
var nd = options.tileNoData ? options.tileNoData : 200;
|
|
@@ -19537,7 +19570,7 @@ var NgwLeaflet = (function () {
|
|
|
19537
19570
|
function createRasterAdapter(_a) {
|
|
19538
19571
|
var layerOptions = _a.layerOptions, webMap = _a.webMap, connector = _a.connector, item = _a.item;
|
|
19539
19572
|
return __awaiter(this, void 0, void 0, function () {
|
|
19540
|
-
var resourceCls, clsAdapterAlias, adapter, layerAdapters, isImageAllowed,
|
|
19573
|
+
var resourceCls, clsAdapterAlias, adapter, layerAdapters, isImageAllowed, AdapterClass, resourceId_1;
|
|
19541
19574
|
return __generator(this, function (_b) {
|
|
19542
19575
|
switch (_b.label) {
|
|
19543
19576
|
case 0:
|
|
@@ -19559,21 +19592,25 @@ var NgwLeaflet = (function () {
|
|
|
19559
19592
|
adapter = 'TILE';
|
|
19560
19593
|
}
|
|
19561
19594
|
}
|
|
19562
|
-
|
|
19563
|
-
if (!
|
|
19595
|
+
AdapterClass = webMap.mapAdapter.layerAdapters[adapter];
|
|
19596
|
+
if (!AdapterClass) return [3 /*break*/, 2];
|
|
19564
19597
|
return [4 /*yield*/, resourceIdFromLayerOptions(layerOptions, connector)];
|
|
19565
19598
|
case 1:
|
|
19566
19599
|
resourceId_1 = _b.sent();
|
|
19567
19600
|
return [2 /*return*/, /** @class */ (function (_super) {
|
|
19568
|
-
__extends(
|
|
19569
|
-
function
|
|
19601
|
+
__extends(RasterAdapter, _super);
|
|
19602
|
+
function RasterAdapter(map, _options) {
|
|
19570
19603
|
var _a;
|
|
19571
19604
|
var _this = _super.call(this, map, _options) || this;
|
|
19572
19605
|
_this.map = map;
|
|
19573
19606
|
// options = {};
|
|
19574
19607
|
_this.item = item;
|
|
19575
19608
|
_this.resourceId = resourceId_1;
|
|
19576
|
-
var opt =
|
|
19609
|
+
var opt = ngwApiToAdapterOptions({
|
|
19610
|
+
options: layerOptions,
|
|
19611
|
+
webMap: webMap,
|
|
19612
|
+
baseUrl: connector.options.baseUrl || '',
|
|
19613
|
+
});
|
|
19577
19614
|
if (opt) {
|
|
19578
19615
|
var layerAdapterOptions = __assign(__assign({}, opt), { setViewDelay: (_a = layerOptions.adapterOptions) === null || _a === void 0 ? void 0 : _a.setViewDelay, params: { resource: resourceId_1 },
|
|
19579
19616
|
// @deprecated
|
|
@@ -19601,10 +19638,10 @@ var NgwLeaflet = (function () {
|
|
|
19601
19638
|
}
|
|
19602
19639
|
return _this;
|
|
19603
19640
|
}
|
|
19604
|
-
|
|
19641
|
+
RasterAdapter.prototype.addLayer = function (addOptions) {
|
|
19605
19642
|
return _super.prototype.addLayer.call(this, __assign(__assign({}, this.options), addOptions));
|
|
19606
19643
|
};
|
|
19607
|
-
|
|
19644
|
+
RasterAdapter.prototype.getIdentificationIds = function () {
|
|
19608
19645
|
return __awaiter(this, void 0, void 0, function () {
|
|
19609
19646
|
var id;
|
|
19610
19647
|
return __generator(this, function (_a) {
|
|
@@ -19616,8 +19653,8 @@ var NgwLeaflet = (function () {
|
|
|
19616
19653
|
});
|
|
19617
19654
|
});
|
|
19618
19655
|
};
|
|
19619
|
-
return
|
|
19620
|
-
}(
|
|
19656
|
+
return RasterAdapter;
|
|
19657
|
+
}(AdapterClass))];
|
|
19621
19658
|
case 2: throw new Error(adapter + ' not supported yet. Only TILE');
|
|
19622
19659
|
}
|
|
19623
19660
|
});
|
|
@@ -20325,16 +20362,17 @@ var NgwLeaflet = (function () {
|
|
|
20325
20362
|
return NgwWebmapItem;
|
|
20326
20363
|
}(Item));
|
|
20327
20364
|
|
|
20328
|
-
function
|
|
20329
|
-
var webMap = _a.webMap,
|
|
20365
|
+
function createOnFirstShowAdapter(_a) {
|
|
20366
|
+
var webMap = _a.webMap, _b = _a.adapterOptions, adapterOptions = _b === void 0 ? {} : _b, onLayerAdded = _a.onLayerAdded, createAdapter = _a.createAdapter;
|
|
20330
20367
|
return __awaiter(this, void 0, void 0, function () {
|
|
20331
20368
|
var OnFirstShowAdapter;
|
|
20332
|
-
return __generator(this, function (
|
|
20369
|
+
return __generator(this, function (_c) {
|
|
20333
20370
|
OnFirstShowAdapter = /** @class */ (function () {
|
|
20334
20371
|
function OnFirstShowAdapter() {
|
|
20335
20372
|
this.options = {};
|
|
20336
20373
|
this.layer = [];
|
|
20337
20374
|
this._removed = false;
|
|
20375
|
+
this._creatingInProgress = false;
|
|
20338
20376
|
}
|
|
20339
20377
|
OnFirstShowAdapter.prototype.addLayer = function () {
|
|
20340
20378
|
return this.layer;
|
|
@@ -20343,8 +20381,10 @@ var NgwLeaflet = (function () {
|
|
|
20343
20381
|
this._removed = true;
|
|
20344
20382
|
this.layer.forEach(function (x) { return webMap.removeLayer(x); });
|
|
20345
20383
|
};
|
|
20384
|
+
OnFirstShowAdapter.prototype.destroyed = function () {
|
|
20385
|
+
return this._removed;
|
|
20386
|
+
};
|
|
20346
20387
|
OnFirstShowAdapter.prototype.showLayer = function () {
|
|
20347
|
-
var _this = this;
|
|
20348
20388
|
this.options.visibility = true;
|
|
20349
20389
|
if (this.layer.length) {
|
|
20350
20390
|
this.layer.forEach(function (x) {
|
|
@@ -20352,31 +20392,50 @@ var NgwLeaflet = (function () {
|
|
|
20352
20392
|
});
|
|
20353
20393
|
}
|
|
20354
20394
|
else {
|
|
20355
|
-
|
|
20356
|
-
|
|
20357
|
-
|
|
20358
|
-
|
|
20359
|
-
|
|
20360
|
-
|
|
20361
|
-
|
|
20362
|
-
|
|
20363
|
-
|
|
20364
|
-
|
|
20365
|
-
|
|
20366
|
-
|
|
20367
|
-
|
|
20368
|
-
|
|
20369
|
-
if (
|
|
20370
|
-
|
|
20395
|
+
this.loadLayer();
|
|
20396
|
+
}
|
|
20397
|
+
};
|
|
20398
|
+
OnFirstShowAdapter.prototype.loadLayer = function () {
|
|
20399
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20400
|
+
var Adapter, adapter, realLayer;
|
|
20401
|
+
return __generator(this, function (_a) {
|
|
20402
|
+
switch (_a.label) {
|
|
20403
|
+
case 0:
|
|
20404
|
+
if (!(!this.layer.length && !this._creatingInProgress)) return [3 /*break*/, 5];
|
|
20405
|
+
this._creatingInProgress = true;
|
|
20406
|
+
return [4 /*yield*/, createAdapter(this)];
|
|
20407
|
+
case 1:
|
|
20408
|
+
Adapter = _a.sent();
|
|
20409
|
+
if (!Adapter) return [3 /*break*/, 5];
|
|
20410
|
+
adapter = new Adapter(webMap.mapAdapter.map, __assign({}, adapterOptions));
|
|
20411
|
+
return [4 /*yield*/, adapter.addLayer({
|
|
20412
|
+
order: this.options.order,
|
|
20413
|
+
headers: this.options.headers,
|
|
20414
|
+
baselayer: this.options.baselayer,
|
|
20415
|
+
})];
|
|
20416
|
+
case 2:
|
|
20417
|
+
realLayer = _a.sent();
|
|
20418
|
+
if (onLayerAdded) {
|
|
20419
|
+
onLayerAdded(adapter);
|
|
20371
20420
|
}
|
|
20372
|
-
|
|
20373
|
-
|
|
20421
|
+
Object.assign(adapter.options, adapterOptions);
|
|
20422
|
+
adapter.layer = realLayer;
|
|
20423
|
+
if (this._removed) {
|
|
20424
|
+
webMap.removeLayer(adapter);
|
|
20374
20425
|
}
|
|
20375
|
-
|
|
20376
|
-
|
|
20426
|
+
if (!this.options.visibility) return [3 /*break*/, 4];
|
|
20427
|
+
return [4 /*yield*/, webMap.showLayer(adapter)];
|
|
20428
|
+
case 3:
|
|
20429
|
+
_a.sent();
|
|
20430
|
+
_a.label = 4;
|
|
20431
|
+
case 4:
|
|
20432
|
+
this.layer.push(adapter);
|
|
20433
|
+
this._creatingInProgress = false;
|
|
20434
|
+
_a.label = 5;
|
|
20435
|
+
case 5: return [2 /*return*/, this.layer];
|
|
20377
20436
|
}
|
|
20378
20437
|
});
|
|
20379
|
-
}
|
|
20438
|
+
});
|
|
20380
20439
|
};
|
|
20381
20440
|
OnFirstShowAdapter.prototype.hideLayer = function () {
|
|
20382
20441
|
this.options.visibility = false;
|
|
@@ -20391,6 +20450,35 @@ var NgwLeaflet = (function () {
|
|
|
20391
20450
|
});
|
|
20392
20451
|
}
|
|
20393
20452
|
|
|
20453
|
+
function createOnFirstShowNgwAdapter(_a) {
|
|
20454
|
+
var webMap = _a.webMap, connector = _a.connector, item = _a.item, _b = _a.adapterOptions, adapterOptions = _b === void 0 ? {} : _b, _c = _a.idPrefix, idPrefix = _c === void 0 ? 'first-show-adapter' : _c;
|
|
20455
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20456
|
+
var createAdapter, onLayerAdded, OnFirstNgwShowAdapter;
|
|
20457
|
+
return __generator(this, function (_d) {
|
|
20458
|
+
createAdapter = function () {
|
|
20459
|
+
return createAsyncAdapter({
|
|
20460
|
+
resource: item.resource_id,
|
|
20461
|
+
adapterOptions: {
|
|
20462
|
+
name: item.display_name,
|
|
20463
|
+
opacity: item.opacity,
|
|
20464
|
+
},
|
|
20465
|
+
}, webMap, connector);
|
|
20466
|
+
};
|
|
20467
|
+
onLayerAdded = function (adapter) {
|
|
20468
|
+
adapter.options.baselayer = false;
|
|
20469
|
+
adapter.id = idPrefix + '-' + item.resource_id;
|
|
20470
|
+
};
|
|
20471
|
+
OnFirstNgwShowAdapter = createOnFirstShowAdapter({
|
|
20472
|
+
webMap: webMap,
|
|
20473
|
+
adapterOptions: adapterOptions,
|
|
20474
|
+
onLayerAdded: onLayerAdded,
|
|
20475
|
+
createAdapter: createAdapter,
|
|
20476
|
+
});
|
|
20477
|
+
return [2 /*return*/, OnFirstNgwShowAdapter];
|
|
20478
|
+
});
|
|
20479
|
+
});
|
|
20480
|
+
}
|
|
20481
|
+
|
|
20394
20482
|
var BookmarkItem = /** @class */ (function () {
|
|
20395
20483
|
function BookmarkItem(options) {
|
|
20396
20484
|
this.options = options;
|
|
@@ -20506,7 +20594,11 @@ var NgwLeaflet = (function () {
|
|
|
20506
20594
|
this.layer.properties.property('visibility').set(false);
|
|
20507
20595
|
}
|
|
20508
20596
|
};
|
|
20597
|
+
/** @deprecated use {@link NgwWebmapLayerAdapter.getBounds} instead */
|
|
20509
20598
|
NgwWebmapLayerAdapter.prototype.getExtent = function () {
|
|
20599
|
+
return this.getBounds();
|
|
20600
|
+
};
|
|
20601
|
+
NgwWebmapLayerAdapter.prototype.getBounds = function () {
|
|
20510
20602
|
var webmap = this.response && this.response.webmap;
|
|
20511
20603
|
if (webmap) {
|
|
20512
20604
|
return getNgwWebmapExtent(webmap);
|
|
@@ -20673,6 +20765,7 @@ var NgwLeaflet = (function () {
|
|
|
20673
20765
|
// to avoid set many basemaps on init
|
|
20674
20766
|
var visibility = enabledAlreadySet ? false : x.enabled;
|
|
20675
20767
|
webMap.addBaseLayer(adapter, {
|
|
20768
|
+
id: WEBMAP_BASELAYER_ID_PREFIX + x.resource_id,
|
|
20676
20769
|
name: x.display_name,
|
|
20677
20770
|
opacity: x.opacity,
|
|
20678
20771
|
visibility: visibility,
|
|
@@ -20706,10 +20799,14 @@ var NgwLeaflet = (function () {
|
|
|
20706
20799
|
return updateImageParams(params, resourceId_1);
|
|
20707
20800
|
};
|
|
20708
20801
|
var adapter = item.layer_adapter.toUpperCase();
|
|
20709
|
-
var layerAdapterOptions =
|
|
20710
|
-
|
|
20711
|
-
|
|
20712
|
-
|
|
20802
|
+
var layerAdapterOptions = ngwApiToAdapterOptions({
|
|
20803
|
+
options: {
|
|
20804
|
+
adapter: adapter,
|
|
20805
|
+
resource: resourceId_1,
|
|
20806
|
+
},
|
|
20807
|
+
webMap: webMap,
|
|
20808
|
+
baseUrl: this.options.connector.options.baseUrl || '',
|
|
20809
|
+
});
|
|
20713
20810
|
item = __assign(__assign({}, item), layerAdapterOptions);
|
|
20714
20811
|
}
|
|
20715
20812
|
}
|
|
@@ -20781,7 +20878,15 @@ var NgwLeaflet = (function () {
|
|
|
20781
20878
|
var NgwResource = /** @class */ (function () {
|
|
20782
20879
|
function NgwResource() {
|
|
20783
20880
|
}
|
|
20881
|
+
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
20784
20882
|
NgwResource.prototype.getExtent = function () {
|
|
20883
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20884
|
+
return __generator(this, function (_a) {
|
|
20885
|
+
return [2 /*return*/, this.getBounds()];
|
|
20886
|
+
});
|
|
20887
|
+
});
|
|
20888
|
+
};
|
|
20889
|
+
NgwResource.prototype.getBounds = function () {
|
|
20785
20890
|
return __awaiter(this, void 0, void 0, function () {
|
|
20786
20891
|
var _a;
|
|
20787
20892
|
return __generator(this, function (_b) {
|
|
@@ -20792,7 +20897,7 @@ var NgwLeaflet = (function () {
|
|
|
20792
20897
|
}
|
|
20793
20898
|
if (!this.item) return [3 /*break*/, 2];
|
|
20794
20899
|
_a = this;
|
|
20795
|
-
return [4 /*yield*/, fetchNgwResourceExtent(this.item, this.connector)
|
|
20900
|
+
return [4 /*yield*/, fetchNgwResourceExtent(this.item, this.connector)];
|
|
20796
20901
|
case 1:
|
|
20797
20902
|
_a._extent = _b.sent();
|
|
20798
20903
|
return [2 /*return*/, this._extent];
|
|
@@ -21165,7 +21270,7 @@ var NgwLeaflet = (function () {
|
|
|
21165
21270
|
MULTILINESTRINGZ: 'line',
|
|
21166
21271
|
MULTIPOLYGONZ: 'polygon',
|
|
21167
21272
|
};
|
|
21168
|
-
function
|
|
21273
|
+
function createNgwLayerAdapter(options, webMap, connector) {
|
|
21169
21274
|
var headers = connector.getAuthorizationHeaders();
|
|
21170
21275
|
if (headers) {
|
|
21171
21276
|
options.headers = headers;
|
|
@@ -21299,25 +21404,20 @@ var NgwLeaflet = (function () {
|
|
|
21299
21404
|
function IdentifyItem(options) {
|
|
21300
21405
|
var f = options.feature;
|
|
21301
21406
|
this.id = f.id;
|
|
21407
|
+
this.geom = f.geom;
|
|
21302
21408
|
this.label = f.label;
|
|
21303
|
-
this.layerId = f.layerId;
|
|
21304
21409
|
this.parent = f.parent;
|
|
21305
21410
|
this.fields = f.fields;
|
|
21306
|
-
this.
|
|
21411
|
+
this.layerId = f.layerId;
|
|
21307
21412
|
this.connector = options.connector;
|
|
21308
21413
|
}
|
|
21309
|
-
IdentifyItem.prototype.identify = function () {
|
|
21414
|
+
IdentifyItem.prototype.identify = function (options) {
|
|
21310
21415
|
var _this = this;
|
|
21416
|
+
if (options === void 0) { options = {}; }
|
|
21311
21417
|
if (this._item) {
|
|
21312
21418
|
return CancelablePromise.resolve(this._item);
|
|
21313
21419
|
}
|
|
21314
|
-
return fetchNgwLayerItem({
|
|
21315
|
-
connector: this.connector,
|
|
21316
|
-
featureId: this.id,
|
|
21317
|
-
resourceId: this.layerId,
|
|
21318
|
-
fields: null,
|
|
21319
|
-
extensions: ['attachment', 'description'],
|
|
21320
|
-
}).then(function (resp) {
|
|
21420
|
+
return fetchNgwLayerItem(__assign({ connector: this.connector, featureId: this.id, resourceId: this.layerId, fields: null, extensions: ['attachment', 'description'] }, options)).then(function (resp) {
|
|
21321
21421
|
_this._item = resp;
|
|
21322
21422
|
_this.geom = resp.geom;
|
|
21323
21423
|
_this.extensions = resp.extensions;
|
|
@@ -21334,6 +21434,16 @@ var NgwLeaflet = (function () {
|
|
|
21334
21434
|
return _this._resource.feature_layer;
|
|
21335
21435
|
});
|
|
21336
21436
|
};
|
|
21437
|
+
IdentifyItem.prototype.getBounds = function () {
|
|
21438
|
+
if (this._extent) {
|
|
21439
|
+
return CancelablePromise.resolve(this._extent);
|
|
21440
|
+
}
|
|
21441
|
+
return fetchNgwLayerItemExtent({
|
|
21442
|
+
connector: this.connector,
|
|
21443
|
+
featureId: this.id,
|
|
21444
|
+
resourceId: this.layerId,
|
|
21445
|
+
});
|
|
21446
|
+
};
|
|
21337
21447
|
IdentifyItem.prototype.geojson = function () {
|
|
21338
21448
|
var _this = this;
|
|
21339
21449
|
if (this._geojson) {
|
|
@@ -21349,6 +21459,8 @@ var NgwLeaflet = (function () {
|
|
|
21349
21459
|
return IdentifyItem;
|
|
21350
21460
|
}());
|
|
21351
21461
|
|
|
21462
|
+
var WEBMAP_BASELAYER_ID_PREFIX = 'webmap-baselayer';
|
|
21463
|
+
|
|
21352
21464
|
function fetchNgwLayerItem(options) {
|
|
21353
21465
|
var params = __assign({}, FEATURE_REQUEST_PARAMS);
|
|
21354
21466
|
updateItemRequestParam(params, options);
|
|
@@ -21657,6 +21769,14 @@ var NgwLeaflet = (function () {
|
|
|
21657
21769
|
return options;
|
|
21658
21770
|
}
|
|
21659
21771
|
|
|
21772
|
+
function getIdentifyRadius(center, zoom, pixelRadius) {
|
|
21773
|
+
pixelRadius = pixelRadius !== null && pixelRadius !== void 0 ? pixelRadius : 10;
|
|
21774
|
+
var metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
|
|
21775
|
+
Math.pow(2, zoom + 8);
|
|
21776
|
+
var radius = pixelRadius * metresPerPixel * 0.0005;
|
|
21777
|
+
return radius;
|
|
21778
|
+
}
|
|
21779
|
+
|
|
21660
21780
|
/**
|
|
21661
21781
|
* Base class containing the logic of interaction WebMap with NextGIS services.
|
|
21662
21782
|
*
|
|
@@ -21675,7 +21795,6 @@ var NgwLeaflet = (function () {
|
|
|
21675
21795
|
* webmapId: 3985
|
|
21676
21796
|
* });
|
|
21677
21797
|
* ```
|
|
21678
|
-
* @public
|
|
21679
21798
|
*/
|
|
21680
21799
|
var NgwMap = /** @class */ (function (_super) {
|
|
21681
21800
|
__extends(NgwMap, _super);
|
|
@@ -21769,7 +21888,7 @@ var NgwLeaflet = (function () {
|
|
|
21769
21888
|
options.adapterOptions.setViewDelay = this.options.setViewDelay;
|
|
21770
21889
|
}
|
|
21771
21890
|
}
|
|
21772
|
-
adapter =
|
|
21891
|
+
adapter = createNgwLayerAdapter(options, this, this.connector);
|
|
21773
21892
|
adapterOpts = __assign(__assign({ visibility: true }, options), options.adapterOptions);
|
|
21774
21893
|
return [4 /*yield*/, this.addLayer(adapter, adapterOpts)];
|
|
21775
21894
|
case 3:
|
|
@@ -21928,7 +22047,7 @@ var NgwLeaflet = (function () {
|
|
|
21928
22047
|
*/
|
|
21929
22048
|
NgwMap.prototype.fitLayer = function (layerDef, options) {
|
|
21930
22049
|
return __awaiter(this, void 0, void 0, function () {
|
|
21931
|
-
var id, ngwLayer,
|
|
22050
|
+
var id, ngwLayer, bounds, item, resourceId;
|
|
21932
22051
|
var _this = this;
|
|
21933
22052
|
return __generator(this, function (_a) {
|
|
21934
22053
|
switch (_a.label) {
|
|
@@ -21941,12 +22060,12 @@ var NgwLeaflet = (function () {
|
|
|
21941
22060
|
}
|
|
21942
22061
|
ngwLayer = id && this._ngwLayers[id];
|
|
21943
22062
|
if (!ngwLayer) return [3 /*break*/, 7];
|
|
21944
|
-
if (!ngwLayer.layer.
|
|
21945
|
-
return [4 /*yield*/, ngwLayer.layer.
|
|
22063
|
+
if (!ngwLayer.layer.getBounds) return [3 /*break*/, 2];
|
|
22064
|
+
return [4 /*yield*/, ngwLayer.layer.getBounds()];
|
|
21946
22065
|
case 1:
|
|
21947
|
-
|
|
21948
|
-
if (
|
|
21949
|
-
this.fitBounds(
|
|
22066
|
+
bounds = _a.sent();
|
|
22067
|
+
if (bounds) {
|
|
22068
|
+
this.fitBounds(bounds, options);
|
|
21950
22069
|
}
|
|
21951
22070
|
return [3 /*break*/, 6];
|
|
21952
22071
|
case 2:
|
|
@@ -22105,10 +22224,10 @@ var NgwLeaflet = (function () {
|
|
|
22105
22224
|
case 1:
|
|
22106
22225
|
_a.sent();
|
|
22107
22226
|
if (this.options.qmsId) {
|
|
22108
|
-
this.
|
|
22227
|
+
this._addQmsBaseLayer();
|
|
22109
22228
|
}
|
|
22110
22229
|
if (this.options.osm) {
|
|
22111
|
-
this.
|
|
22230
|
+
this._addOsmBaseLayer();
|
|
22112
22231
|
}
|
|
22113
22232
|
resources = [];
|
|
22114
22233
|
layerFitAllowed = this._isFitFromResource();
|
|
@@ -22153,10 +22272,10 @@ var NgwLeaflet = (function () {
|
|
|
22153
22272
|
});
|
|
22154
22273
|
});
|
|
22155
22274
|
};
|
|
22156
|
-
NgwMap.prototype.
|
|
22275
|
+
NgwMap.prototype._addOsmBaseLayer = function () {
|
|
22157
22276
|
this.addBaseLayer('OSM');
|
|
22158
22277
|
};
|
|
22159
|
-
NgwMap.prototype.
|
|
22278
|
+
NgwMap.prototype._addQmsBaseLayer = function () {
|
|
22160
22279
|
var qmsId;
|
|
22161
22280
|
var qmsLayerName;
|
|
22162
22281
|
if (Array.isArray(this.options.qmsId)) {
|
|
@@ -22207,7 +22326,7 @@ var NgwLeaflet = (function () {
|
|
|
22207
22326
|
};
|
|
22208
22327
|
NgwMap.prototype._selectFromNgwRaster = function (ev) {
|
|
22209
22328
|
return __awaiter(this, void 0, void 0, function () {
|
|
22210
|
-
var promises, layers, getIdsPromise, getIds, ids, pixelRadius, center, zoom,
|
|
22329
|
+
var promises, layers, getIdsPromise, getIds, ids, pixelRadius, center, zoom, radius, selectPromise;
|
|
22211
22330
|
var _this = this;
|
|
22212
22331
|
return __generator(this, function (_a) {
|
|
22213
22332
|
switch (_a.label) {
|
|
@@ -22252,9 +22371,7 @@ var NgwLeaflet = (function () {
|
|
|
22252
22371
|
this._emitStatusEvent('ngw:select', null);
|
|
22253
22372
|
return [2 /*return*/];
|
|
22254
22373
|
}
|
|
22255
|
-
|
|
22256
|
-
Math.pow(2, zoom + 8);
|
|
22257
|
-
radius = pixelRadius * metresPerPixel * 0.0005;
|
|
22374
|
+
radius = getIdentifyRadius(center, zoom, pixelRadius);
|
|
22258
22375
|
selectPromise = sendIdentifyRequest(ev, {
|
|
22259
22376
|
layers: ids,
|
|
22260
22377
|
connector: this.connector,
|
|
@@ -22305,83 +22422,6 @@ var NgwLeaflet = (function () {
|
|
|
22305
22422
|
return NgwMap;
|
|
22306
22423
|
}(WebMap));
|
|
22307
22424
|
|
|
22308
|
-
var typeAlias = {
|
|
22309
|
-
Point: 'point',
|
|
22310
|
-
LineString: 'line',
|
|
22311
|
-
MultiPoint: 'point',
|
|
22312
|
-
Polygon: 'polygon',
|
|
22313
|
-
MultiLineString: 'line',
|
|
22314
|
-
MultiPolygon: 'polygon',
|
|
22315
|
-
GeometryCollection: 'polygon',
|
|
22316
|
-
};
|
|
22317
|
-
var PAINT = {
|
|
22318
|
-
stroke: false,
|
|
22319
|
-
opacity: 1,
|
|
22320
|
-
};
|
|
22321
|
-
var backAliases = {};
|
|
22322
|
-
for (var a in typeAlias) {
|
|
22323
|
-
var layerType = typeAlias[a];
|
|
22324
|
-
var backAlias = backAliases[layerType] || [];
|
|
22325
|
-
backAlias.push(a);
|
|
22326
|
-
backAliases[layerType] = backAlias;
|
|
22327
|
-
}
|
|
22328
|
-
function findMostFrequentGeomType(arr) {
|
|
22329
|
-
var counts = {};
|
|
22330
|
-
for (var fry = 0; fry < arr.length; fry++) {
|
|
22331
|
-
counts[arr[fry]] = 1 + (counts[arr[fry]] || 0);
|
|
22332
|
-
}
|
|
22333
|
-
var maxName = '';
|
|
22334
|
-
for (var c in counts) {
|
|
22335
|
-
var maxCount = maxName ? counts[maxName] : 0;
|
|
22336
|
-
if (counts[c] > maxCount) {
|
|
22337
|
-
maxName = c;
|
|
22338
|
-
}
|
|
22339
|
-
}
|
|
22340
|
-
return maxName;
|
|
22341
|
-
}
|
|
22342
|
-
function detectType(geojson) {
|
|
22343
|
-
var geometry;
|
|
22344
|
-
if (geojson.type === 'FeatureCollection') {
|
|
22345
|
-
var featuresTypes = geojson.features.map(function (f) { return f.geometry.type; });
|
|
22346
|
-
geometry = findMostFrequentGeomType(featuresTypes);
|
|
22347
|
-
}
|
|
22348
|
-
else if (geojson.type === 'GeometryCollection') {
|
|
22349
|
-
var geometryTypes = geojson.geometries.map(function (g) { return g.type; });
|
|
22350
|
-
geometry = findMostFrequentGeomType(geometryTypes);
|
|
22351
|
-
}
|
|
22352
|
-
else if (geojson.type === 'Feature') {
|
|
22353
|
-
geometry = geojson.geometry.type;
|
|
22354
|
-
}
|
|
22355
|
-
else {
|
|
22356
|
-
geometry = geojson.type;
|
|
22357
|
-
}
|
|
22358
|
-
return geometry;
|
|
22359
|
-
}
|
|
22360
|
-
function geometryFilter(geometry, type) {
|
|
22361
|
-
var geoJsonGeometry = backAliases[type] || [];
|
|
22362
|
-
return geoJsonGeometry.indexOf(geometry) !== -1;
|
|
22363
|
-
}
|
|
22364
|
-
function filterGeometries(data, type) {
|
|
22365
|
-
if (data.type === 'FeatureCollection') {
|
|
22366
|
-
var _data = data;
|
|
22367
|
-
_data.features = _data.features.filter(function (f) {
|
|
22368
|
-
return geometryFilter(f.geometry.type, type);
|
|
22369
|
-
});
|
|
22370
|
-
}
|
|
22371
|
-
else if (data.type === 'Feature') {
|
|
22372
|
-
var allow = geometryFilter(data.geometry.type, type);
|
|
22373
|
-
if (!allow) {
|
|
22374
|
-
return false;
|
|
22375
|
-
}
|
|
22376
|
-
}
|
|
22377
|
-
else if (data.type === 'GeometryCollection') {
|
|
22378
|
-
var _data = data;
|
|
22379
|
-
_data.geometries = _data.geometries.filter(function (g) {
|
|
22380
|
-
return geometryFilter(g.type, type);
|
|
22381
|
-
});
|
|
22382
|
-
}
|
|
22383
|
-
return data;
|
|
22384
|
-
}
|
|
22385
22425
|
function convertMapClickEvent(evt) {
|
|
22386
22426
|
var coord = evt.containerPoint;
|
|
22387
22427
|
var latLng = evt.latlng;
|
|
@@ -22482,6 +22522,118 @@ var NgwLeaflet = (function () {
|
|
|
22482
22522
|
return AttributionControl;
|
|
22483
22523
|
}(leafletSrc.exports.Control.Attribution));
|
|
22484
22524
|
|
|
22525
|
+
function boundsToArray(bounds) {
|
|
22526
|
+
var ne = bounds.getNorthEast();
|
|
22527
|
+
var sw = bounds.getSouthWest();
|
|
22528
|
+
return [sw.lng, sw.lat, ne.lng, ne.lat];
|
|
22529
|
+
}
|
|
22530
|
+
|
|
22531
|
+
var typeAlias = {
|
|
22532
|
+
Point: 'point',
|
|
22533
|
+
LineString: 'line',
|
|
22534
|
+
MultiPoint: 'point',
|
|
22535
|
+
Polygon: 'polygon',
|
|
22536
|
+
MultiLineString: 'line',
|
|
22537
|
+
MultiPolygon: 'polygon',
|
|
22538
|
+
GeometryCollection: 'polygon',
|
|
22539
|
+
};
|
|
22540
|
+
var PAINT = {
|
|
22541
|
+
stroke: false,
|
|
22542
|
+
opacity: 1,
|
|
22543
|
+
};
|
|
22544
|
+
var backAliases = {};
|
|
22545
|
+
for (var a in typeAlias) {
|
|
22546
|
+
var layerType = typeAlias[a];
|
|
22547
|
+
var backAlias = backAliases[layerType] || [];
|
|
22548
|
+
backAlias.push(a);
|
|
22549
|
+
backAliases[layerType] = backAlias;
|
|
22550
|
+
}
|
|
22551
|
+
function geometryFilter(geometry, type) {
|
|
22552
|
+
var geoJsonGeometry = backAliases[type] || [];
|
|
22553
|
+
return geoJsonGeometry.indexOf(geometry) !== -1;
|
|
22554
|
+
}
|
|
22555
|
+
function filterGeometries(data, type) {
|
|
22556
|
+
if (data.type === 'FeatureCollection') {
|
|
22557
|
+
var _data = data;
|
|
22558
|
+
_data.features = _data.features.filter(function (f) {
|
|
22559
|
+
return geometryFilter(f.geometry.type, type);
|
|
22560
|
+
});
|
|
22561
|
+
}
|
|
22562
|
+
else if (data.type === 'Feature') {
|
|
22563
|
+
var allow = geometryFilter(data.geometry.type, type);
|
|
22564
|
+
if (!allow) {
|
|
22565
|
+
return false;
|
|
22566
|
+
}
|
|
22567
|
+
}
|
|
22568
|
+
else if (data.type === 'GeometryCollection') {
|
|
22569
|
+
var _data = data;
|
|
22570
|
+
_data.geometries = _data.geometries.filter(function (g) {
|
|
22571
|
+
return geometryFilter(g.type, type);
|
|
22572
|
+
});
|
|
22573
|
+
}
|
|
22574
|
+
return data;
|
|
22575
|
+
}
|
|
22576
|
+
function featuresBounds(features) {
|
|
22577
|
+
var geoJsonLayer = new leafletSrc.exports.GeoJSON();
|
|
22578
|
+
var features_ = Array.isArray(features) ? features : [features];
|
|
22579
|
+
features_.forEach(function (f) { return geoJsonLayer.addData(f); });
|
|
22580
|
+
return geoJsonLayer.getBounds();
|
|
22581
|
+
}
|
|
22582
|
+
function getFeaturesBounds(features) {
|
|
22583
|
+
return boundsToArray(featuresBounds(features));
|
|
22584
|
+
}
|
|
22585
|
+
function getFeaturesCenter(features) {
|
|
22586
|
+
var _a = featuresBounds(features).getCenter(), lat = _a.lat, lng = _a.lng;
|
|
22587
|
+
return [lng, lat];
|
|
22588
|
+
}
|
|
22589
|
+
function createFeaturePositionOptions(features) {
|
|
22590
|
+
return {
|
|
22591
|
+
getBounds: function () { return getFeaturesBounds(features); },
|
|
22592
|
+
getCenter: function () { return getFeaturesCenter(features); },
|
|
22593
|
+
};
|
|
22594
|
+
}
|
|
22595
|
+
|
|
22596
|
+
function createMouseEvent(_a) {
|
|
22597
|
+
var layer = _a.layer, source = _a.source;
|
|
22598
|
+
var layer_ = source.target;
|
|
22599
|
+
var feature = layer_.feature;
|
|
22600
|
+
var opt = __assign({ layer: layer, feature: feature, event: convertMapClickEvent(source), source: source }, createFeaturePositionOptions(feature));
|
|
22601
|
+
return opt;
|
|
22602
|
+
}
|
|
22603
|
+
|
|
22604
|
+
function findMostFrequentGeomType(arr) {
|
|
22605
|
+
var counts = {};
|
|
22606
|
+
for (var fry = 0; fry < arr.length; fry++) {
|
|
22607
|
+
counts[arr[fry]] = 1 + (counts[arr[fry]] || 0);
|
|
22608
|
+
}
|
|
22609
|
+
var maxName = '';
|
|
22610
|
+
for (var c in counts) {
|
|
22611
|
+
var maxCount = maxName ? counts[maxName] : 0;
|
|
22612
|
+
if (counts[c] > maxCount) {
|
|
22613
|
+
maxName = c;
|
|
22614
|
+
}
|
|
22615
|
+
}
|
|
22616
|
+
return maxName;
|
|
22617
|
+
}
|
|
22618
|
+
function detectType(geojson) {
|
|
22619
|
+
var geometry;
|
|
22620
|
+
if (geojson.type === 'FeatureCollection') {
|
|
22621
|
+
var featuresTypes = geojson.features.map(function (f) { return f.geometry.type; });
|
|
22622
|
+
geometry = findMostFrequentGeomType(featuresTypes);
|
|
22623
|
+
}
|
|
22624
|
+
else if (geojson.type === 'GeometryCollection') {
|
|
22625
|
+
var geometryTypes = geojson.geometries.map(function (g) { return g.type; });
|
|
22626
|
+
geometry = findMostFrequentGeomType(geometryTypes);
|
|
22627
|
+
}
|
|
22628
|
+
else if (geojson.type === 'Feature') {
|
|
22629
|
+
geometry = geojson.geometry.type;
|
|
22630
|
+
}
|
|
22631
|
+
else {
|
|
22632
|
+
geometry = geojson.type;
|
|
22633
|
+
}
|
|
22634
|
+
return geometry;
|
|
22635
|
+
}
|
|
22636
|
+
|
|
22485
22637
|
var BaseAdapter = /** @class */ (function () {
|
|
22486
22638
|
function BaseAdapter(map, options) {
|
|
22487
22639
|
this.map = map;
|
|
@@ -22497,7 +22649,8 @@ var NgwLeaflet = (function () {
|
|
|
22497
22649
|
this.pane = pane;
|
|
22498
22650
|
}
|
|
22499
22651
|
}
|
|
22500
|
-
BaseAdapter.prototype.addLayer = function (
|
|
22652
|
+
BaseAdapter.prototype.addLayer = function (options) {
|
|
22653
|
+
Object.assign(this.options, options);
|
|
22501
22654
|
return undefined;
|
|
22502
22655
|
};
|
|
22503
22656
|
return BaseAdapter;
|
|
@@ -22518,12 +22671,12 @@ var NgwLeaflet = (function () {
|
|
|
22518
22671
|
_this.$unselect = function () {
|
|
22519
22672
|
_this.unselect();
|
|
22520
22673
|
};
|
|
22521
|
-
_this.layer = new leafletSrc.exports.FeatureGroup([], { pane: _this.pane });
|
|
22522
22674
|
return _this;
|
|
22523
22675
|
}
|
|
22524
22676
|
GeoJsonAdapter.prototype.addLayer = function (options) {
|
|
22525
|
-
this.options
|
|
22677
|
+
Object.assign(this.options, options);
|
|
22526
22678
|
this.paint = options.paint;
|
|
22679
|
+
this.layer = new leafletSrc.exports.FeatureGroup([], __assign(__assign({}, options.nativeOptions), { pane: this.pane }));
|
|
22527
22680
|
this.selectedPaint = options.selectedPaint;
|
|
22528
22681
|
options.paint = this.paint;
|
|
22529
22682
|
if (options.data) {
|
|
@@ -22571,8 +22724,9 @@ var NgwLeaflet = (function () {
|
|
|
22571
22724
|
}
|
|
22572
22725
|
};
|
|
22573
22726
|
GeoJsonAdapter.prototype.getSelected = function () {
|
|
22727
|
+
var _this = this;
|
|
22574
22728
|
return this._selectedLayers.map(function (x) {
|
|
22575
|
-
return { feature: x.feature, layer: x };
|
|
22729
|
+
return __assign({ target: _this, feature: x.feature, layer: x }, createFeaturePositionOptions(x.feature));
|
|
22576
22730
|
});
|
|
22577
22731
|
};
|
|
22578
22732
|
GeoJsonAdapter.prototype.getFiltered = function () {
|
|
@@ -22582,28 +22736,28 @@ var NgwLeaflet = (function () {
|
|
|
22582
22736
|
var _this = this;
|
|
22583
22737
|
// Some optimization
|
|
22584
22738
|
this._filterFun = fun;
|
|
22585
|
-
|
|
22586
|
-
var
|
|
22587
|
-
if (
|
|
22588
|
-
|
|
22589
|
-
|
|
22590
|
-
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22739
|
+
var layer_ = this.layer;
|
|
22740
|
+
var map = layer_ && layer_._map;
|
|
22741
|
+
if (layer_ && map) {
|
|
22742
|
+
layer_.remove();
|
|
22743
|
+
var filteredLayers_1 = [];
|
|
22744
|
+
this._layers.forEach(function (_a) {
|
|
22745
|
+
var feature = _a.feature, layer = _a.layer;
|
|
22746
|
+
if (layer) {
|
|
22747
|
+
var ok = fun
|
|
22748
|
+
? fun(__assign({ target: _this, feature: feature, layer: layer }, createFeaturePositionOptions(feature)))
|
|
22749
|
+
: true;
|
|
22750
|
+
if (ok) {
|
|
22751
|
+
layer_.addLayer(layer);
|
|
22752
|
+
filteredLayers_1.push(__assign({ target: _this, feature: feature, layer: layer }, createFeaturePositionOptions(feature)));
|
|
22753
|
+
}
|
|
22754
|
+
else {
|
|
22755
|
+
layer_.removeLayer(layer);
|
|
22756
|
+
}
|
|
22601
22757
|
}
|
|
22602
|
-
}
|
|
22603
|
-
|
|
22604
|
-
|
|
22605
|
-
if (_map) {
|
|
22606
|
-
this.layer.addTo(_map);
|
|
22758
|
+
});
|
|
22759
|
+
this._filteredLayers = filteredLayers_1;
|
|
22760
|
+
layer_.addTo(map);
|
|
22607
22761
|
}
|
|
22608
22762
|
return this._filteredLayers;
|
|
22609
22763
|
};
|
|
@@ -22615,34 +22769,32 @@ var NgwLeaflet = (function () {
|
|
|
22615
22769
|
return this._layers.map(function (_a) {
|
|
22616
22770
|
var layer = _a.layer, feature = _a.feature;
|
|
22617
22771
|
var visible = layer && !!layer._map;
|
|
22618
|
-
return {
|
|
22619
|
-
feature: feature,
|
|
22620
|
-
layer: layer,
|
|
22621
|
-
visible: visible,
|
|
22622
|
-
target: _this,
|
|
22623
|
-
};
|
|
22772
|
+
return __assign({ feature: feature, layer: layer, visible: visible, target: _this }, createFeaturePositionOptions(feature));
|
|
22624
22773
|
});
|
|
22625
22774
|
};
|
|
22626
22775
|
GeoJsonAdapter.prototype.clearLayer = function (cb) {
|
|
22627
22776
|
this.unselect();
|
|
22628
|
-
|
|
22629
|
-
|
|
22630
|
-
|
|
22631
|
-
|
|
22632
|
-
var
|
|
22633
|
-
if (
|
|
22634
|
-
var
|
|
22635
|
-
if (
|
|
22636
|
-
|
|
22637
|
-
|
|
22777
|
+
var layer_ = this.layer;
|
|
22778
|
+
if (layer_) {
|
|
22779
|
+
if (cb) {
|
|
22780
|
+
for (var fry = this._layers.length; fry--;) {
|
|
22781
|
+
var def = this._layers[fry];
|
|
22782
|
+
if (def) {
|
|
22783
|
+
var feature = def.feature, layer = def.layer;
|
|
22784
|
+
if (feature && layer) {
|
|
22785
|
+
var exist = cb(feature);
|
|
22786
|
+
if (exist) {
|
|
22787
|
+
layer_.removeLayer(layer);
|
|
22788
|
+
this._layers.splice(fry, 1);
|
|
22789
|
+
}
|
|
22638
22790
|
}
|
|
22639
22791
|
}
|
|
22640
22792
|
}
|
|
22641
22793
|
}
|
|
22642
|
-
|
|
22643
|
-
|
|
22644
|
-
|
|
22645
|
-
|
|
22794
|
+
else {
|
|
22795
|
+
layer_.clearLayers();
|
|
22796
|
+
this._layers = [];
|
|
22797
|
+
}
|
|
22646
22798
|
}
|
|
22647
22799
|
};
|
|
22648
22800
|
GeoJsonAdapter.prototype.setData = function (data) {
|
|
@@ -22704,12 +22856,14 @@ var NgwLeaflet = (function () {
|
|
|
22704
22856
|
});
|
|
22705
22857
|
}
|
|
22706
22858
|
};
|
|
22859
|
+
/** @deprecated use {@link GeoJsonAdapter.getBounds} instead */
|
|
22707
22860
|
GeoJsonAdapter.prototype.getExtent = function () {
|
|
22708
|
-
|
|
22709
|
-
|
|
22710
|
-
|
|
22711
|
-
if (
|
|
22712
|
-
|
|
22861
|
+
return this.getBounds();
|
|
22862
|
+
};
|
|
22863
|
+
GeoJsonAdapter.prototype.getBounds = function () {
|
|
22864
|
+
if (this.layer) {
|
|
22865
|
+
var bounds = this.layer.getBounds();
|
|
22866
|
+
return boundsToArray(bounds);
|
|
22713
22867
|
}
|
|
22714
22868
|
};
|
|
22715
22869
|
GeoJsonAdapter.prototype.setOpacity = function (value) {
|
|
@@ -22782,14 +22936,7 @@ var NgwLeaflet = (function () {
|
|
|
22782
22936
|
}
|
|
22783
22937
|
};
|
|
22784
22938
|
if (!options.createPopupContent) return [3 /*break*/, 2];
|
|
22785
|
-
return [4 /*yield*/, options.createPopupContent({
|
|
22786
|
-
layer: layer,
|
|
22787
|
-
feature: feature,
|
|
22788
|
-
target: this,
|
|
22789
|
-
type: type,
|
|
22790
|
-
close: close,
|
|
22791
|
-
onClose: onClose,
|
|
22792
|
-
})];
|
|
22939
|
+
return [4 /*yield*/, options.createPopupContent(__assign({ layer: layer, feature: feature, target: this, type: type, close: close, onClose: onClose }, createFeaturePositionOptions(feature)))];
|
|
22793
22940
|
case 1:
|
|
22794
22941
|
_d = _e.sent();
|
|
22795
22942
|
return [3 /*break*/, 3];
|
|
@@ -22949,75 +23096,81 @@ var NgwLeaflet = (function () {
|
|
|
22949
23096
|
lopt = this._createPaintOptions(paint, type);
|
|
22950
23097
|
}
|
|
22951
23098
|
lopt.onEachFeature = function (feature, layer) {
|
|
23099
|
+
_this._onEachFeature(feature, layer);
|
|
23100
|
+
};
|
|
23101
|
+
return lopt;
|
|
23102
|
+
};
|
|
23103
|
+
GeoJsonAdapter.prototype._onEachFeature = function (feature, layer) {
|
|
23104
|
+
var _this = this;
|
|
23105
|
+
var layer_ = this.layer;
|
|
23106
|
+
if (layer_) {
|
|
23107
|
+
var def_1 = __assign({ target: this, feature: feature, layer: layer }, createFeaturePositionOptions(feature));
|
|
22952
23108
|
// @ts-ignore
|
|
22953
|
-
layer.options.pane =
|
|
22954
|
-
|
|
23109
|
+
layer.options.pane = this.pane;
|
|
23110
|
+
this._layers.push(def_1);
|
|
22955
23111
|
var ok = true;
|
|
22956
|
-
if (
|
|
22957
|
-
ok =
|
|
23112
|
+
if (this._filterFun) {
|
|
23113
|
+
ok = this._filterFun(def_1);
|
|
22958
23114
|
}
|
|
22959
23115
|
if (ok) {
|
|
22960
|
-
var _a =
|
|
23116
|
+
var _a = this.options, popup = _a.popup, popupOptions = _a.popupOptions, selectable = _a.selectable, interactive = _a.interactive, selectOnHover = _a.selectOnHover;
|
|
22961
23117
|
// @ts-ignore
|
|
22962
23118
|
layer.options.interactive = defined(interactive) ? interactive : true;
|
|
22963
|
-
|
|
23119
|
+
layer_.addLayer(layer);
|
|
22964
23120
|
if (selectable) {
|
|
22965
23121
|
if (selectOnHover) {
|
|
22966
23122
|
layer.on('mouseover', function () {
|
|
22967
|
-
_this._selectLayer(
|
|
23123
|
+
_this._selectLayer(def_1, 'hover');
|
|
22968
23124
|
});
|
|
22969
23125
|
layer.on('mouseout', function () {
|
|
22970
|
-
_this._unSelectLayer(
|
|
23126
|
+
_this._unSelectLayer(def_1);
|
|
22971
23127
|
});
|
|
22972
23128
|
}
|
|
22973
23129
|
else {
|
|
22974
|
-
layer.on('click', function (e) { return _this._selectOnLayerClick(e); },
|
|
23130
|
+
layer.on('click', function (e) { return _this._selectOnLayerClick(e); }, this);
|
|
22975
23131
|
}
|
|
22976
23132
|
}
|
|
22977
|
-
|
|
23133
|
+
this._handleMouseEvents(layer);
|
|
22978
23134
|
if (popup) {
|
|
22979
|
-
|
|
23135
|
+
this._openPopup(__assign({ target: this, layer: layer, feature: feature }, createFeaturePositionOptions(feature)), popupOptions, 'api');
|
|
22980
23136
|
}
|
|
22981
|
-
|
|
23137
|
+
this._updateTooltip({ layer: layer, feature: feature });
|
|
22982
23138
|
}
|
|
22983
|
-
}
|
|
22984
|
-
return lopt;
|
|
23139
|
+
}
|
|
22985
23140
|
};
|
|
22986
23141
|
GeoJsonAdapter.prototype._handleMouseEvents = function (layer) {
|
|
22987
23142
|
var _this = this;
|
|
22988
23143
|
var isSelected = function (l) { return _this._selectedLayers.indexOf(l) !== -1; };
|
|
22989
|
-
var createMouseOptions = function (e) {
|
|
22990
|
-
var layer_ = e.target;
|
|
22991
|
-
return {
|
|
22992
|
-
layer: _this,
|
|
22993
|
-
feature: layer_.feature,
|
|
22994
|
-
event: convertMapClickEvent(e),
|
|
22995
|
-
source: e,
|
|
22996
|
-
};
|
|
22997
|
-
};
|
|
22998
23144
|
var _a = this.options, onClick = _a.onClick, onLayerClick = _a.onLayerClick, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver;
|
|
22999
23145
|
// TODO: remove backward compatibility for onLayerClick
|
|
23000
23146
|
var onClick_ = onClick || onLayerClick;
|
|
23001
23147
|
if (onClick_) {
|
|
23002
23148
|
layer.on('click', function (e) {
|
|
23003
|
-
onClick_(__assign({ selected: isSelected(e.target) },
|
|
23149
|
+
onClick_(__assign({ selected: isSelected(e.target) }, _this._createMouseEvent(e)));
|
|
23004
23150
|
}, this);
|
|
23005
23151
|
}
|
|
23006
23152
|
if (onMouseOut) {
|
|
23007
23153
|
layer.on('mouseout', function (e) {
|
|
23008
|
-
onMouseOut(
|
|
23154
|
+
onMouseOut(_this._createMouseEvent(e));
|
|
23009
23155
|
}, this);
|
|
23010
23156
|
}
|
|
23011
23157
|
if (onMouseOver) {
|
|
23012
23158
|
layer.on('mouseover', function (e) {
|
|
23013
|
-
onMouseOver(
|
|
23159
|
+
onMouseOver(_this._createMouseEvent(e));
|
|
23014
23160
|
}, this);
|
|
23015
23161
|
}
|
|
23016
23162
|
};
|
|
23163
|
+
GeoJsonAdapter.prototype._createMouseEvent = function (source) {
|
|
23164
|
+
return createMouseEvent({
|
|
23165
|
+
layer: this,
|
|
23166
|
+
source: source,
|
|
23167
|
+
});
|
|
23168
|
+
};
|
|
23017
23169
|
GeoJsonAdapter.prototype._selectOnLayerClick = function (e) {
|
|
23018
23170
|
leafletSrc.exports.DomEvent.stopPropagation(e);
|
|
23019
23171
|
var layer = e.target;
|
|
23020
|
-
var
|
|
23172
|
+
var feature = layer.feature;
|
|
23173
|
+
var def = __assign({ target: this, layer: layer, feature: feature }, createFeaturePositionOptions(feature));
|
|
23021
23174
|
var isSelected = this._selectedLayers.find(function (x) { return x.layer === layer; });
|
|
23022
23175
|
if (isSelected) {
|
|
23023
23176
|
if (this.options && this.options.unselectOnSecondClick) {
|
|
@@ -23046,11 +23199,8 @@ var NgwLeaflet = (function () {
|
|
|
23046
23199
|
this._openPopup(def, popupOptions, type, latlng);
|
|
23047
23200
|
}
|
|
23048
23201
|
if (this.options.onSelect) {
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
layer: this,
|
|
23052
|
-
features: def.feature ? [def.feature] : [],
|
|
23053
|
-
});
|
|
23202
|
+
var features = def.feature ? [def.feature] : [];
|
|
23203
|
+
this.options.onSelect(__assign({ type: type, layer: this, features: features }, createFeaturePositionOptions(features)));
|
|
23054
23204
|
}
|
|
23055
23205
|
};
|
|
23056
23206
|
GeoJsonAdapter.prototype._unSelectLayer = function (def) {
|
|
@@ -23398,7 +23548,7 @@ var NgwLeaflet = (function () {
|
|
|
23398
23548
|
if (url) {
|
|
23399
23549
|
options = __assign({ transparent: true }, options);
|
|
23400
23550
|
var updateWmsParamsFromOpt_1 = options.updateWmsParams;
|
|
23401
|
-
this.layer = new ImageLayer(url, __assign(__assign({ pane: this.pane, headers: options.headers, setViewDelay: options.setViewDelay }, options), options.params));
|
|
23551
|
+
this.layer = new ImageLayer(url, __assign(__assign(__assign({ pane: this.pane, headers: options.headers, setViewDelay: options.setViewDelay }, options), options.params), options.nativeOptions));
|
|
23402
23552
|
if (updateWmsParamsFromOpt_1) {
|
|
23403
23553
|
var updateWmsParams_1 = this.layer.updateWmsParams;
|
|
23404
23554
|
this.layer.updateWmsParams = function (map) {
|
|
@@ -23533,26 +23683,18 @@ var NgwLeaflet = (function () {
|
|
|
23533
23683
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
23534
23684
|
}
|
|
23535
23685
|
WmsAdapter.prototype.addLayer = function (options) {
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
};
|
|
23547
|
-
var layer = void 0;
|
|
23548
|
-
if (opt.headers) {
|
|
23549
|
-
layer = new WmsLayer(url, __assign(__assign({}, layerOptions), { headers: opt.headers }));
|
|
23550
|
-
}
|
|
23551
|
-
else {
|
|
23552
|
-
layer = new leafletSrc.exports.TileLayer.WMS(url, layerOptions);
|
|
23553
|
-
}
|
|
23554
|
-
return layer;
|
|
23686
|
+
Object.assign(this.options, options);
|
|
23687
|
+
var url = options.url, opt = __rest(options, ["url"]);
|
|
23688
|
+
if (url) {
|
|
23689
|
+
var layerOptions = __assign({ pane: this.pane, attribution: opt.attribution, minZoom: opt.minZoom, maxZoom: opt.maxZoom, layers: options.layers, format: options.format }, options.nativeOptions);
|
|
23690
|
+
var layer = void 0;
|
|
23691
|
+
if (opt.headers) {
|
|
23692
|
+
layer = new WmsLayer(url, __assign(__assign({}, layerOptions), { headers: opt.headers }));
|
|
23693
|
+
}
|
|
23694
|
+
else {
|
|
23695
|
+
layer = new leafletSrc.exports.TileLayer.WMS(url, layerOptions);
|
|
23555
23696
|
}
|
|
23697
|
+
return layer;
|
|
23556
23698
|
}
|
|
23557
23699
|
};
|
|
23558
23700
|
return WmsAdapter;
|
|
@@ -23564,7 +23706,7 @@ var NgwLeaflet = (function () {
|
|
|
23564
23706
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
23565
23707
|
}
|
|
23566
23708
|
OsmAdapter.prototype.addLayer = function (options) {
|
|
23567
|
-
var url =
|
|
23709
|
+
var url = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
|
23568
23710
|
return _super.prototype.addLayer.call(this, __assign(__assign({ name: 'OpenStreetMap', attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' }, options), { url: url }));
|
|
23569
23711
|
};
|
|
23570
23712
|
return OsmAdapter;
|
|
@@ -23857,3 +23999,4 @@ var NgwLeaflet = (function () {
|
|
|
23857
23999
|
return NgwLeaflet;
|
|
23858
24000
|
|
|
23859
24001
|
}());
|
|
24002
|
+
//# sourceMappingURL=ngw-leaflet.global.js.map
|