@nextgis/ngw-leaflet 1.11.8 → 1.12.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/ngw-leaflet.esm-browser.js +5005 -3995
- package/lib/ngw-leaflet.esm-browser.js.map +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js +16 -2
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.js +99 -19
- package/lib/ngw-leaflet.esm-bundler.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.prod.js +15 -1
- package/lib/ngw-leaflet.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-leaflet.global.js +145 -89
- package/lib/ngw-leaflet.global.js.map +1 -1
- package/lib/ngw-leaflet.global.prod.js +2 -2
- package/lib/ngw-leaflet.global.prod.js.map +1 -1
- 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.12.0; author: NextGIS */
|
|
2
2
|
import 'leaflet/dist/leaflet.css';
|
|
3
3
|
import { Icon } from 'leaflet';
|
|
4
4
|
import { NgwMap } from '@nextgis/ngw-map';
|
|
@@ -7,6 +7,86 @@ import iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';
|
|
|
7
7
|
import iconUrl from 'leaflet/dist/images/marker-icon.png';
|
|
8
8
|
import shadowUrl from 'leaflet/dist/images/marker-shadow.png';
|
|
9
9
|
|
|
10
|
+
/*! *****************************************************************************
|
|
11
|
+
Copyright (c) Microsoft Corporation.
|
|
12
|
+
|
|
13
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
purpose with or without fee is hereby granted.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
17
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
18
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
19
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
20
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
21
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
22
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
+
***************************************************************************** */
|
|
24
|
+
/* global Reflect, Promise */
|
|
25
|
+
|
|
26
|
+
var extendStatics = function(d, b) {
|
|
27
|
+
extendStatics = Object.setPrototypeOf ||
|
|
28
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
29
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
30
|
+
return extendStatics(d, b);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function __extends(d, b) {
|
|
34
|
+
if (typeof b !== "function" && b !== null)
|
|
35
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
36
|
+
extendStatics(d, b);
|
|
37
|
+
function __() { this.constructor = d; }
|
|
38
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var __assign = function() {
|
|
42
|
+
__assign = Object.assign || function __assign(t) {
|
|
43
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
44
|
+
s = arguments[i];
|
|
45
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
46
|
+
}
|
|
47
|
+
return t;
|
|
48
|
+
};
|
|
49
|
+
return __assign.apply(this, arguments);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
53
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
54
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
55
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
56
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
57
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
58
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function __generator(thisArg, body) {
|
|
63
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
64
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
65
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
+
while (_) try {
|
|
69
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
70
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
|
+
switch (op[0]) {
|
|
72
|
+
case 0: case 1: t = op; break;
|
|
73
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
74
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
75
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
76
|
+
default:
|
|
77
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
78
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
79
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
80
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
81
|
+
if (t[2]) _.ops.pop();
|
|
82
|
+
_.trys.pop(); continue;
|
|
83
|
+
}
|
|
84
|
+
op = body.call(thisArg, _);
|
|
85
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
86
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
10
90
|
function styleInject(css, ref) {
|
|
11
91
|
if ( ref === void 0 ) ref = {};
|
|
12
92
|
var insertAt = ref.insertAt;
|
|
@@ -37,15 +117,6 @@ function styleInject(css, ref) {
|
|
|
37
117
|
var css_248z = ".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}";
|
|
38
118
|
styleInject(css_248z);
|
|
39
119
|
|
|
40
|
-
/**
|
|
41
|
-
* Single-file bundle for rapid deployment of {@link https://leafletjs.com/ | Leaflet }-based web-gis applications with NextGIS services
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* Styles images and other assets are already in bundle, you don't need to include anything except one JS file!
|
|
45
|
-
*
|
|
46
|
-
* @packageDocumentation
|
|
47
|
-
* @module ngw-leaflet
|
|
48
|
-
*/
|
|
49
120
|
// @ts-ignore
|
|
50
121
|
delete Icon.Default.prototype._getIconUrl;
|
|
51
122
|
Icon.Default.mergeOptions({
|
|
@@ -71,16 +142,25 @@ Icon.Default.mergeOptions({
|
|
|
71
142
|
* });
|
|
72
143
|
* ```
|
|
73
144
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
145
|
+
var NgwLeaflet = /** @class */ (function (_super) {
|
|
146
|
+
__extends(NgwLeaflet, _super);
|
|
147
|
+
function NgwLeaflet(options) {
|
|
148
|
+
var _this = this;
|
|
149
|
+
options = __assign(__assign({}, options), { mapAdapter: new LeafletMapAdapter() });
|
|
150
|
+
_this = _super.call(this, options) || this;
|
|
151
|
+
return _this;
|
|
78
152
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
153
|
+
NgwLeaflet.create = function (options) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
+
var ngwMap;
|
|
156
|
+
return __generator(this, function (_a) {
|
|
157
|
+
ngwMap = new NgwLeaflet(options);
|
|
158
|
+
return [2 /*return*/, ngwMap.onLoad()];
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
return NgwLeaflet;
|
|
163
|
+
}(NgwMap));
|
|
84
164
|
if (window && !window.NgwMap) {
|
|
85
165
|
window.NgwMap = NgwLeaflet;
|
|
86
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngw-leaflet.esm-bundler.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Single-file bundle for rapid deployment of {@link https://leafletjs.com/ | Leaflet }-based web-gis applications with NextGIS services\n *\n * @remarks\n * Styles images and other assets are already in bundle, you don't need to include anything except one JS file!\n *\n * @packageDocumentation\n * @module ngw-leaflet\n */\nimport 'leaflet/dist/leaflet.css';\nimport './leaflet-style-override.css';\n\nimport { Icon } from 'leaflet';\nimport { NgwMap, NgwMapOptions } from '@nextgis/ngw-map';\nimport LeafletMapAdapter from '@nextgis/leaflet-map-adapter';\n\nimport iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\nimport iconUrl from 'leaflet/dist/images/marker-icon.png';\nimport shadowUrl from 'leaflet/dist/images/marker-shadow.png';\n\nimport { Map } from 'leaflet';\n\n// @ts-ignore\ndelete Icon.Default.prototype._getIconUrl;\n\nIcon.Default.mergeOptions({\n iconRetinaUrl: iconRetinaUrl,\n iconUrl: iconUrl,\n shadowUrl: shadowUrl,\n});\n\n/**\n * Displaying the [NgwMap](ngw-map-api)\n * using the [LeafletMapAdapter](leaflet-map-adapter-api)\n *\n * @example\n * ```javascript\n * // Base initialization\n * // [live demo](http://code.nextgis.com/ngw-leaflet-examples-ngw-webmap)\n * import { NgwMap } from '@nextgis/ngw-leaflet';\n *\n * const ngwMap = new NgwMap({\n * target: 'map',\n * qmsId: 448,\n * baseUrl: 'https://demo.nextgis.com',\n * webmapId: 3985\n * });\n * ```\n */\nclass NgwLeaflet extends NgwMap<Map> {\n constructor(options: NgwMapOptions) {\n options = { ...options, mapAdapter: new LeafletMapAdapter() };\n super(options);\n }\n static async create(options: NgwMapOptions): Promise<NgwLeaflet> {\n const ngwMap = new NgwLeaflet(options);\n return ngwMap.onLoad();\n }\n}\n\nexport default NgwLeaflet;\n\nif ((window as any) && !(window as any).NgwMap) {\n (window as any).NgwMap = NgwLeaflet;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ngw-leaflet.esm-bundler.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Single-file bundle for rapid deployment of {@link https://leafletjs.com/ | Leaflet }-based web-gis applications with NextGIS services\n *\n * @remarks\n * Styles images and other assets are already in bundle, you don't need to include anything except one JS file!\n *\n * @packageDocumentation\n * @module ngw-leaflet\n */\nimport 'leaflet/dist/leaflet.css';\nimport './leaflet-style-override.css';\n\nimport { Icon } from 'leaflet';\nimport { NgwMap, NgwMapOptions } from '@nextgis/ngw-map';\nimport LeafletMapAdapter from '@nextgis/leaflet-map-adapter';\n\nimport iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\nimport iconUrl from 'leaflet/dist/images/marker-icon.png';\nimport shadowUrl from 'leaflet/dist/images/marker-shadow.png';\n\nimport { Map } from 'leaflet';\n\n// @ts-ignore\ndelete Icon.Default.prototype._getIconUrl;\n\nIcon.Default.mergeOptions({\n iconRetinaUrl: iconRetinaUrl,\n iconUrl: iconUrl,\n shadowUrl: shadowUrl,\n});\n\n/**\n * Displaying the [NgwMap](ngw-map-api)\n * using the [LeafletMapAdapter](leaflet-map-adapter-api)\n *\n * @example\n * ```javascript\n * // Base initialization\n * // [live demo](http://code.nextgis.com/ngw-leaflet-examples-ngw-webmap)\n * import { NgwMap } from '@nextgis/ngw-leaflet';\n *\n * const ngwMap = new NgwMap({\n * target: 'map',\n * qmsId: 448,\n * baseUrl: 'https://demo.nextgis.com',\n * webmapId: 3985\n * });\n * ```\n */\nclass NgwLeaflet extends NgwMap<Map> {\n constructor(options: NgwMapOptions) {\n options = { ...options, mapAdapter: new LeafletMapAdapter() };\n super(options);\n }\n static async create(options: NgwMapOptions): Promise<NgwLeaflet> {\n const ngwMap = new NgwLeaflet(options);\n return ngwMap.onLoad();\n }\n}\n\nexport default NgwLeaflet;\n\nif ((window as any) && !(window as any).NgwMap) {\n (window as any).NgwMap = NgwLeaflet;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;ACHA;AACA,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC;AAE1C,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IACxB,aAAa,EAAE,aAAa;IAC5B,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;IAkByB,8BAAW;IAClC,oBAAY,OAAsB;QAAlC,iBAGC;QAFC,OAAO,yBAAQ,OAAO,KAAE,UAAU,EAAE,IAAI,iBAAiB,EAAE,GAAE,CAAC;QAC9D,QAAA,kBAAM,OAAO,CAAC,SAAC;;KAChB;IACY,iBAAM,GAAnB,UAAoB,OAAsB;;;;gBAClC,MAAM,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;gBACvC,sBAAO,MAAM,CAAC,MAAM,EAAE,EAAC;;;KACxB;IACH,iBAAC;AAAD,CATA,CAAyB,MAAM,GAS9B;AAID,IAAK,MAAc,IAAI,CAAE,MAAc,CAAC,MAAM,EAAE;IAC7C,MAAc,CAAC,MAAM,GAAG,UAAU,CAAC;;;;;"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import"leaflet/dist/leaflet.css";import{Icon as
|
|
1
|
+
import"leaflet/dist/leaflet.css";import{Icon as t}from"leaflet";import{NgwMap as e}from"@nextgis/ngw-map";import n from"@nextgis/leaflet-map-adapter";import r from"leaflet/dist/images/marker-icon-2x.png";import o from"leaflet/dist/images/marker-icon.png";import a from"leaflet/dist/images/marker-shadow.png";
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function c(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(e){a(e)}}function l(t){try{c(r.throw(t))}catch(e){a(e)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,l)}c((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(l){a=[6,l],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}"),delete t.Default.prototype._getIconUrl,t.Default.mergeOptions({iconRetinaUrl:r,iconUrl:o,shadowUrl:a});var f=function(t){function e(e){return e=l(l({},e),{mapAdapter:new n}),t.call(this,e)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.create=function(t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return[2,new e(t).onLoad()]}))}))},e}(e);window&&!window.NgwMap&&(window.NgwMap=f);export{f as default};
|
|
2
16
|
//# sourceMappingURL=ngw-leaflet.esm-bundler.prod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngw-leaflet.esm-bundler.prod.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Single-file bundle for rapid deployment of {@link https://leafletjs.com/ | Leaflet }-based web-gis applications with NextGIS services\n *\n * @remarks\n * Styles images and other assets are already in bundle, you don't need to include anything except one JS file!\n *\n * @packageDocumentation\n * @module ngw-leaflet\n */\nimport 'leaflet/dist/leaflet.css';\nimport './leaflet-style-override.css';\n\nimport { Icon } from 'leaflet';\nimport { NgwMap, NgwMapOptions } from '@nextgis/ngw-map';\nimport LeafletMapAdapter from '@nextgis/leaflet-map-adapter';\n\nimport iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\nimport iconUrl from 'leaflet/dist/images/marker-icon.png';\nimport shadowUrl from 'leaflet/dist/images/marker-shadow.png';\n\nimport { Map } from 'leaflet';\n\n// @ts-ignore\ndelete Icon.Default.prototype._getIconUrl;\n\nIcon.Default.mergeOptions({\n iconRetinaUrl: iconRetinaUrl,\n iconUrl: iconUrl,\n shadowUrl: shadowUrl,\n});\n\n/**\n * Displaying the [NgwMap](ngw-map-api)\n * using the [LeafletMapAdapter](leaflet-map-adapter-api)\n *\n * @example\n * ```javascript\n * // Base initialization\n * // [live demo](http://code.nextgis.com/ngw-leaflet-examples-ngw-webmap)\n * import { NgwMap } from '@nextgis/ngw-leaflet';\n *\n * const ngwMap = new NgwMap({\n * target: 'map',\n * qmsId: 448,\n * baseUrl: 'https://demo.nextgis.com',\n * webmapId: 3985\n * });\n * ```\n */\nclass NgwLeaflet extends NgwMap<Map> {\n constructor(options: NgwMapOptions) {\n options = { ...options, mapAdapter: new LeafletMapAdapter() };\n super(options);\n }\n static async create(options: NgwMapOptions): Promise<NgwLeaflet> {\n const ngwMap = new NgwLeaflet(options);\n return ngwMap.onLoad();\n }\n}\n\nexport default NgwLeaflet;\n\nif ((window as any) && !(window as any).NgwMap) {\n (window as any).NgwMap = NgwLeaflet;\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Icon","Default","prototype","_getIconUrl","mergeOptions","iconRetinaUrl","iconUrl","shadowUrl","
|
|
1
|
+
{"version":3,"file":"ngw-leaflet.esm-bundler.prod.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Single-file bundle for rapid deployment of {@link https://leafletjs.com/ | Leaflet }-based web-gis applications with NextGIS services\n *\n * @remarks\n * Styles images and other assets are already in bundle, you don't need to include anything except one JS file!\n *\n * @packageDocumentation\n * @module ngw-leaflet\n */\nimport 'leaflet/dist/leaflet.css';\nimport './leaflet-style-override.css';\n\nimport { Icon } from 'leaflet';\nimport { NgwMap, NgwMapOptions } from '@nextgis/ngw-map';\nimport LeafletMapAdapter from '@nextgis/leaflet-map-adapter';\n\nimport iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\nimport iconUrl from 'leaflet/dist/images/marker-icon.png';\nimport shadowUrl from 'leaflet/dist/images/marker-shadow.png';\n\nimport { Map } from 'leaflet';\n\n// @ts-ignore\ndelete Icon.Default.prototype._getIconUrl;\n\nIcon.Default.mergeOptions({\n iconRetinaUrl: iconRetinaUrl,\n iconUrl: iconUrl,\n shadowUrl: shadowUrl,\n});\n\n/**\n * Displaying the [NgwMap](ngw-map-api)\n * using the [LeafletMapAdapter](leaflet-map-adapter-api)\n *\n * @example\n * ```javascript\n * // Base initialization\n * // [live demo](http://code.nextgis.com/ngw-leaflet-examples-ngw-webmap)\n * import { NgwMap } from '@nextgis/ngw-leaflet';\n *\n * const ngwMap = new NgwMap({\n * target: 'map',\n * qmsId: 448,\n * baseUrl: 'https://demo.nextgis.com',\n * webmapId: 3985\n * });\n * ```\n */\nclass NgwLeaflet extends NgwMap<Map> {\n constructor(options: NgwMapOptions) {\n options = { ...options, mapAdapter: new LeafletMapAdapter() };\n super(options);\n }\n static async create(options: NgwMapOptions): Promise<NgwLeaflet> {\n const ngwMap = new NgwLeaflet(options);\n return ngwMap.onLoad();\n }\n}\n\nexport default NgwLeaflet;\n\nif ((window as any) && !(window as any).NgwMap) {\n (window as any).NgwMap = NgwLeaflet;\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Icon","Default","prototype","_getIconUrl","mergeOptions","iconRetinaUrl","iconUrl","shadowUrl","options","mapAdapter","LeafletMapAdapter","_super","__extends","NgwLeaflet","onLoad","NgwMap","window"],"mappings":";;;;;;;;;;;;;;6zDAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,IAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,2HCAvCe,EAAKC,QAAQC,UAAUC,YAE9BH,EAAKC,QAAQG,aAAa,CACxBC,cAAeA,EACfC,QAASA,EACTC,UAAWA,sBAsBX,WAAYC,UACVA,SAAeA,IAASC,WAAY,IAAIC,IACxCC,YAAMH,SAMV,0PATyBI,MAKVC,SAAb,SAAoBL,sEAElB,SADe,IAAIK,EAAWL,GAChBM,oBAPOC,GAapBC,SAAoBA,OAAeD,SACrCC,OAAeD,OAASF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-leaflet; version: 1.
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 1.12.0; author: NextGIS */
|
|
2
2
|
var NgwLeaflet = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -16772,6 +16772,9 @@ var NgwLeaflet = (function () {
|
|
|
16772
16772
|
_c.sent();
|
|
16773
16773
|
_c.label = 11;
|
|
16774
16774
|
case 11:
|
|
16775
|
+
if (options.onAdded) {
|
|
16776
|
+
options.onAdded(_adapter);
|
|
16777
|
+
}
|
|
16775
16778
|
this._emitLayerEvent('layer:add', layerId, _adapter);
|
|
16776
16779
|
return [2 /*return*/, _adapter];
|
|
16777
16780
|
case 12: return [2 /*return*/, Promise.reject('No adapter')];
|
|
@@ -16912,8 +16915,15 @@ var NgwLeaflet = (function () {
|
|
|
16912
16915
|
WebMapLayers.prototype.addTileLayer = function (url, options) {
|
|
16913
16916
|
return this.addLayer('TILE', __assign(__assign({}, options), { url: url }));
|
|
16914
16917
|
};
|
|
16915
|
-
|
|
16916
|
-
|
|
16918
|
+
WebMapLayers.prototype.addImageLayer = function (urlOrOptions, options) {
|
|
16919
|
+
var url;
|
|
16920
|
+
if (typeof urlOrOptions === 'string') {
|
|
16921
|
+
url = urlOrOptions;
|
|
16922
|
+
}
|
|
16923
|
+
else {
|
|
16924
|
+
url = urlOrOptions.url;
|
|
16925
|
+
options = urlOrOptions;
|
|
16926
|
+
}
|
|
16917
16927
|
return this.addLayer('IMAGE', __assign(__assign({}, options), { url: url }));
|
|
16918
16928
|
};
|
|
16919
16929
|
/**
|
|
@@ -19228,10 +19238,10 @@ var NgwLeaflet = (function () {
|
|
|
19228
19238
|
function createGeoJsonFeature(item) {
|
|
19229
19239
|
var geometry = item.geom;
|
|
19230
19240
|
var feature = {
|
|
19241
|
+
geometry: geometry,
|
|
19231
19242
|
id: item.id,
|
|
19232
19243
|
type: 'Feature',
|
|
19233
19244
|
properties: item.fields,
|
|
19234
|
-
geometry: geometry,
|
|
19235
19245
|
};
|
|
19236
19246
|
return feature;
|
|
19237
19247
|
}
|
|
@@ -19254,68 +19264,85 @@ var NgwLeaflet = (function () {
|
|
|
19254
19264
|
}
|
|
19255
19265
|
// NGW REST API is not able to filtering by combined queries
|
|
19256
19266
|
// therefore the filter is divided into several requests
|
|
19257
|
-
function createFeatureFieldFilterQueries(opt
|
|
19267
|
+
function createFeatureFieldFilterQueries(opt) {
|
|
19268
|
+
var queries = getQueries(opt);
|
|
19269
|
+
return CancelablePromise.all(queries).then(function (itemsParts) {
|
|
19270
|
+
// this list of ids used for optimization
|
|
19271
|
+
var ids = [];
|
|
19272
|
+
var items = [];
|
|
19273
|
+
for (var _i = 0, itemsParts_1 = itemsParts; _i < itemsParts_1.length; _i++) {
|
|
19274
|
+
var part = itemsParts_1[_i];
|
|
19275
|
+
for (var _a = 0, part_1 = part; _a < part_1.length; _a++) {
|
|
19276
|
+
var item = part_1[_a];
|
|
19277
|
+
if (!ids.includes(item.id)) {
|
|
19278
|
+
items.push(item);
|
|
19279
|
+
ids.push(item.id);
|
|
19280
|
+
}
|
|
19281
|
+
}
|
|
19282
|
+
}
|
|
19283
|
+
var offset = opt.offset !== undefined ? opt.offset : 0;
|
|
19284
|
+
var limit = opt.limit !== undefined ? opt.limit : items.length;
|
|
19285
|
+
if (opt.offset || opt.limit) {
|
|
19286
|
+
return items.splice(offset, limit);
|
|
19287
|
+
}
|
|
19288
|
+
return items;
|
|
19289
|
+
});
|
|
19290
|
+
}
|
|
19291
|
+
function createParam(pf) {
|
|
19292
|
+
var field = pf[0], operation = pf[1], value = pf[2];
|
|
19293
|
+
var isFldStr = field !== 'id' ? 'fld_' : '';
|
|
19294
|
+
var vStart = '';
|
|
19295
|
+
var vEnd = '';
|
|
19296
|
+
var field_ = String(field)
|
|
19297
|
+
.trim()
|
|
19298
|
+
.replace(/^(%?)(.+?)(%?)$/, function (m, a, b, c) {
|
|
19299
|
+
vStart = a;
|
|
19300
|
+
vEnd = c;
|
|
19301
|
+
return b;
|
|
19302
|
+
});
|
|
19303
|
+
var v = vStart + value + vEnd;
|
|
19304
|
+
return ["".concat(isFldStr).concat(field_, "__").concat(operation), v];
|
|
19305
|
+
}
|
|
19306
|
+
function getQueries(opt, _queries, _parentAllParams) {
|
|
19258
19307
|
if (_queries === void 0) { _queries = []; }
|
|
19259
19308
|
if (_parentAllParams === void 0) { _parentAllParams = []; }
|
|
19260
19309
|
var filters = opt.filters;
|
|
19261
19310
|
var logic = typeof filters[0] === 'string' ? filters[0] : 'all';
|
|
19262
19311
|
var filters_ = filters.filter(function (x) { return Array.isArray(x); });
|
|
19263
|
-
var createParam = function (pf) {
|
|
19264
|
-
var field = pf[0], operation = pf[1], value = pf[2];
|
|
19265
|
-
var isFldStr = field !== 'id' ? 'fld_' : '';
|
|
19266
|
-
var vStart = '';
|
|
19267
|
-
var vEnd = '';
|
|
19268
|
-
var field_ = String(field)
|
|
19269
|
-
.trim()
|
|
19270
|
-
.replace(/^(%?)(.+?)(%?)$/, function (m, a, b, c) {
|
|
19271
|
-
vStart = a;
|
|
19272
|
-
vEnd = c;
|
|
19273
|
-
return b;
|
|
19274
|
-
});
|
|
19275
|
-
var v = vStart + value + vEnd;
|
|
19276
|
-
return ["".concat(isFldStr).concat(field_, "__").concat(operation), v];
|
|
19277
|
-
};
|
|
19278
19312
|
if (logic === 'any') {
|
|
19279
|
-
filters_.
|
|
19313
|
+
for (var _i = 0, filters_1 = filters_; _i < filters_1.length; _i++) {
|
|
19314
|
+
var f = filters_1[_i];
|
|
19280
19315
|
if (isPropertyFilter(f)) {
|
|
19281
19316
|
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), [createParam(f)], false) })));
|
|
19282
19317
|
}
|
|
19283
19318
|
else {
|
|
19284
|
-
|
|
19319
|
+
getQueries(__assign(__assign({}, opt), { filters: f }), _queries, __spreadArray([], _parentAllParams, true));
|
|
19285
19320
|
}
|
|
19286
|
-
}
|
|
19321
|
+
}
|
|
19287
19322
|
}
|
|
19288
19323
|
else if (logic === 'all') {
|
|
19289
|
-
var
|
|
19324
|
+
var filters_3 = [];
|
|
19290
19325
|
var propertiesFilterList = [];
|
|
19291
|
-
for (var
|
|
19292
|
-
var f =
|
|
19326
|
+
for (var _a = 0, filters_2 = filters_; _a < filters_2.length; _a++) {
|
|
19327
|
+
var f = filters_2[_a];
|
|
19293
19328
|
if (isPropertyFilter(f)) {
|
|
19294
|
-
|
|
19329
|
+
filters_3.push(createParam(f));
|
|
19295
19330
|
}
|
|
19296
19331
|
else {
|
|
19297
19332
|
propertiesFilterList.push(f);
|
|
19298
19333
|
}
|
|
19299
19334
|
}
|
|
19300
19335
|
if (propertiesFilterList.length) {
|
|
19301
|
-
for (var
|
|
19302
|
-
var x = propertiesFilterList_1[
|
|
19303
|
-
|
|
19336
|
+
for (var _b = 0, propertiesFilterList_1 = propertiesFilterList; _b < propertiesFilterList_1.length; _b++) {
|
|
19337
|
+
var x = propertiesFilterList_1[_b];
|
|
19338
|
+
getQueries(__assign(__assign({}, opt), { filters: x }), _queries, __spreadArray(__spreadArray([], _parentAllParams, true), filters_3, true));
|
|
19304
19339
|
}
|
|
19305
19340
|
}
|
|
19306
19341
|
else {
|
|
19307
|
-
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true),
|
|
19342
|
+
_queries.push(fetchNgwLayerItemsRequest(__assign(__assign({}, opt), { paramList: __spreadArray(__spreadArray([], _parentAllParams, true), filters_3, true) })));
|
|
19308
19343
|
}
|
|
19309
19344
|
}
|
|
19310
|
-
return
|
|
19311
|
-
var items = itemsParts.reduce(function (a, b) { return a.concat(b); }, []);
|
|
19312
|
-
var offset = opt.offset !== undefined ? opt.offset : 0;
|
|
19313
|
-
var limit = opt.limit !== undefined ? opt.limit : items.length;
|
|
19314
|
-
if (opt.offset || opt.limit) {
|
|
19315
|
-
return items.splice(offset, limit);
|
|
19316
|
-
}
|
|
19317
|
-
return items;
|
|
19318
|
-
});
|
|
19345
|
+
return _queries;
|
|
19319
19346
|
}
|
|
19320
19347
|
function createWktFromCoordArray(coord) {
|
|
19321
19348
|
var polygon = coord.map(function (_a) {
|
|
@@ -19327,7 +19354,7 @@ var NgwLeaflet = (function () {
|
|
|
19327
19354
|
}
|
|
19328
19355
|
function fetchNgwLayerItemsRequest(options) {
|
|
19329
19356
|
var params = __assign({}, FEATURE_REQUEST_PARAMS);
|
|
19330
|
-
var
|
|
19357
|
+
var limit = options.limit, offset = options.offset, orderBy = options.orderBy, paramList = options.paramList, connector = options.connector, intersects = options.intersects, resourceId = options.resourceId;
|
|
19331
19358
|
if (limit) {
|
|
19332
19359
|
if (limit !== Number.POSITIVE_INFINITY) {
|
|
19333
19360
|
params.limit = limit;
|
|
@@ -19340,7 +19367,6 @@ var NgwLeaflet = (function () {
|
|
|
19340
19367
|
if (offset) {
|
|
19341
19368
|
params.offset = offset;
|
|
19342
19369
|
}
|
|
19343
|
-
// TODO: fix type for options
|
|
19344
19370
|
updateItemRequestParam(params, options);
|
|
19345
19371
|
if (orderBy) {
|
|
19346
19372
|
params.order_by = orderBy.join(',');
|
|
@@ -19392,12 +19418,16 @@ var NgwLeaflet = (function () {
|
|
|
19392
19418
|
var filters = options.filters;
|
|
19393
19419
|
if (filters) {
|
|
19394
19420
|
return createFeatureFieldFilterQueries(__assign(__assign({}, options), { filters: filters })).then(function (data) {
|
|
19421
|
+
var _a;
|
|
19422
|
+
var clientFilterValidate = (_a = options.clientFilterValidate) !== null && _a !== void 0 ? _a : true;
|
|
19395
19423
|
// Additional client-side filter check
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19424
|
+
if (clientFilterValidate) {
|
|
19425
|
+
data = data.filter(function (y) {
|
|
19426
|
+
var fields = prepareNgwFieldsToPropertiesFilter(__assign(__assign({}, y.fields), { id: y.id }));
|
|
19427
|
+
var result = propertiesFilter(fields, filters);
|
|
19428
|
+
return result;
|
|
19429
|
+
});
|
|
19430
|
+
}
|
|
19401
19431
|
return data;
|
|
19402
19432
|
});
|
|
19403
19433
|
}
|
|
@@ -19756,6 +19786,26 @@ var NgwLeaflet = (function () {
|
|
|
19756
19786
|
});
|
|
19757
19787
|
}
|
|
19758
19788
|
|
|
19789
|
+
function getImageAdapterOptions(_a) {
|
|
19790
|
+
var resourceId = _a.resourceId, baseUrl = _a.baseUrl, nd = _a.nd, headers = _a.headers;
|
|
19791
|
+
var url = baseUrl + '/api/component/render/image';
|
|
19792
|
+
var params = { resource: resourceId };
|
|
19793
|
+
if (nd) {
|
|
19794
|
+
params.nd = nd;
|
|
19795
|
+
}
|
|
19796
|
+
return {
|
|
19797
|
+
url: url,
|
|
19798
|
+
resourceId: resourceId,
|
|
19799
|
+
headers: headers,
|
|
19800
|
+
params: params,
|
|
19801
|
+
updateWmsParams: function (params_) {
|
|
19802
|
+
if (nd) {
|
|
19803
|
+
params_.nd = nd;
|
|
19804
|
+
}
|
|
19805
|
+
return updateImageParams(params_, resourceId);
|
|
19806
|
+
},
|
|
19807
|
+
};
|
|
19808
|
+
}
|
|
19759
19809
|
function ngwApiToAdapterOptions(_a) {
|
|
19760
19810
|
var options = _a.options, webMap = _a.webMap, baseUrl = _a.baseUrl;
|
|
19761
19811
|
var adapter = options.adapter || 'IMAGE';
|
|
@@ -19767,16 +19817,12 @@ var NgwLeaflet = (function () {
|
|
|
19767
19817
|
if (typeof resourceId === 'number') {
|
|
19768
19818
|
if (adapter === 'IMAGE') {
|
|
19769
19819
|
if (isImageAllowed) {
|
|
19770
|
-
|
|
19771
|
-
return {
|
|
19772
|
-
url: url,
|
|
19820
|
+
return getImageAdapterOptions({
|
|
19773
19821
|
resourceId: resourceId,
|
|
19774
19822
|
headers: options.headers,
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
},
|
|
19779
|
-
};
|
|
19823
|
+
nd: nd,
|
|
19824
|
+
baseUrl: baseUrl,
|
|
19825
|
+
});
|
|
19780
19826
|
}
|
|
19781
19827
|
else {
|
|
19782
19828
|
adapter = 'TILE';
|
|
@@ -21191,6 +21237,7 @@ var NgwLeaflet = (function () {
|
|
|
21191
21237
|
NgwWebmapLayerAdapter.prototype._setBasemaps = function (baseWebmap) {
|
|
21192
21238
|
var _this = this;
|
|
21193
21239
|
var webMap = this.options.webMap;
|
|
21240
|
+
// to avoid set many basemaps on init
|
|
21194
21241
|
var enabledAlreadySet = false;
|
|
21195
21242
|
var _loop_1 = function (x) {
|
|
21196
21243
|
createOnFirstShowNgwAdapter({
|
|
@@ -21199,9 +21246,11 @@ var NgwLeaflet = (function () {
|
|
|
21199
21246
|
item: x,
|
|
21200
21247
|
adapterOptions: { crossOrigin: this_1.options.crossOrigin },
|
|
21201
21248
|
}).then(function (adapter) {
|
|
21202
|
-
// to avoid set many basemaps on init
|
|
21203
21249
|
var visibility = enabledAlreadySet ? false : x.enabled;
|
|
21204
|
-
|
|
21250
|
+
if (x.enabled) {
|
|
21251
|
+
enabledAlreadySet = true;
|
|
21252
|
+
}
|
|
21253
|
+
return webMap
|
|
21205
21254
|
.addBaseLayer(adapter, {
|
|
21206
21255
|
id: WEBMAP_BASELAYER_ID_PREFIX + x.resource_id,
|
|
21207
21256
|
name: x.display_name,
|
|
@@ -21211,9 +21260,6 @@ var NgwLeaflet = (function () {
|
|
|
21211
21260
|
.then(function (l) {
|
|
21212
21261
|
l.id && _this._webmapBaselayersIds.push(l.id);
|
|
21213
21262
|
});
|
|
21214
|
-
if (x.enabled) {
|
|
21215
|
-
enabledAlreadySet = true;
|
|
21216
|
-
}
|
|
21217
21263
|
});
|
|
21218
21264
|
};
|
|
21219
21265
|
var this_1 = this;
|
|
@@ -21695,7 +21741,7 @@ var NgwLeaflet = (function () {
|
|
|
21695
21741
|
function updateImageParams(params, resourceId) {
|
|
21696
21742
|
var bbox = params.bbox, width = params.width, height = params.height, nd = params.nd;
|
|
21697
21743
|
return {
|
|
21698
|
-
resource: resourceId,
|
|
21744
|
+
resource: Array.isArray(resourceId) ? resourceId.join(',') : resourceId,
|
|
21699
21745
|
extent: bbox,
|
|
21700
21746
|
size: width + ',' + height,
|
|
21701
21747
|
timestamp: Date.now(),
|
|
@@ -22003,38 +22049,45 @@ var NgwLeaflet = (function () {
|
|
|
22003
22049
|
}
|
|
22004
22050
|
return CancelablePromise.resolve(undefined);
|
|
22005
22051
|
}
|
|
22006
|
-
function
|
|
22007
|
-
|
|
22008
|
-
var _a = ev.lngLat, lng = _a[0], lat = _a[1];
|
|
22052
|
+
function featureLayerIdentify(options) {
|
|
22053
|
+
var g = options.geom;
|
|
22009
22054
|
var geom = [];
|
|
22010
|
-
if (
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
geom = polygon_1.coordinates[0];
|
|
22055
|
+
if (Array.isArray(g)) {
|
|
22056
|
+
geom = g;
|
|
22057
|
+
}
|
|
22058
|
+
else {
|
|
22059
|
+
var polygon = g.type === 'Feature' ? g.geometry : g.type === 'Polygon' ? g : false;
|
|
22060
|
+
if (polygon) {
|
|
22061
|
+
geom = polygon.coordinates[0];
|
|
22018
22062
|
}
|
|
22019
22063
|
}
|
|
22020
|
-
if (
|
|
22021
|
-
|
|
22064
|
+
if (geom) {
|
|
22065
|
+
// create wkt string
|
|
22066
|
+
var polygonStr = [];
|
|
22067
|
+
for (var _i = 0, geom_1 = geom; _i < geom_1.length; _i++) {
|
|
22068
|
+
var _a = geom_1[_i], lng = _a[0], lat = _a[1];
|
|
22069
|
+
var _b = degrees2meters(lng, lat), x = _b[0], y = _b[1];
|
|
22070
|
+
polygonStr.push(x + ' ' + y);
|
|
22071
|
+
}
|
|
22072
|
+
var wkt = "POLYGON((".concat(polygonStr.join(', '), "))");
|
|
22073
|
+
var layers = options.layers;
|
|
22074
|
+
var data = {
|
|
22075
|
+
geom: wkt,
|
|
22076
|
+
srs: 3857,
|
|
22077
|
+
layers: layers,
|
|
22078
|
+
};
|
|
22079
|
+
return options.connector.post('feature_layer.identify', { data: data });
|
|
22022
22080
|
}
|
|
22023
|
-
|
|
22024
|
-
|
|
22025
|
-
|
|
22026
|
-
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
var
|
|
22031
|
-
var
|
|
22032
|
-
|
|
22033
|
-
geom: wkt,
|
|
22034
|
-
srs: 3857,
|
|
22035
|
-
layers: layers,
|
|
22036
|
-
};
|
|
22037
|
-
return options.connector.post('feature_layer.identify', { data: data });
|
|
22081
|
+
else {
|
|
22082
|
+
throw new Error('Not valid geometry format to make intersection');
|
|
22083
|
+
}
|
|
22084
|
+
}
|
|
22085
|
+
function sendIdentifyRequest(ev, options) {
|
|
22086
|
+
var _a;
|
|
22087
|
+
deprecatedMapClick(ev);
|
|
22088
|
+
var _b = ev.lngLat, lng = _b[0], lat = _b[1];
|
|
22089
|
+
var geom = (_a = options.geom) !== null && _a !== void 0 ? _a : getCirclePolygonCoordinates(lng, lat, options.radius);
|
|
22090
|
+
return featureLayerIdentify(__assign(__assign({}, options), { geom: geom }));
|
|
22038
22091
|
}
|
|
22039
22092
|
function createIdentifyItem(opt) {
|
|
22040
22093
|
return new IdentifyItem(opt);
|
|
@@ -22920,6 +22973,9 @@ var NgwLeaflet = (function () {
|
|
|
22920
22973
|
link.title = title;
|
|
22921
22974
|
link.setAttribute('role', 'button');
|
|
22922
22975
|
link.setAttribute('aria-label', title);
|
|
22976
|
+
if (options.addClass) {
|
|
22977
|
+
link.classList.add(options.addClass);
|
|
22978
|
+
}
|
|
22923
22979
|
leafletSrc.exports.DomEvent.disableClickPropagation(link);
|
|
22924
22980
|
leafletSrc.exports.DomEvent.on(link, 'click', leafletSrc.exports.DomEvent.stop);
|
|
22925
22981
|
if (options.html instanceof HTMLElement) {
|