@nextgis/ngw-leaflet 1.18.11 → 1.18.15
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 +35 -35
- package/lib/ngw-leaflet.esm-browser.js.map +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js +2 -2
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.js +1 -1
- package/lib/ngw-leaflet.global.js +36 -36
- 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 +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-leaflet; version: 1.18.
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 1.18.15; author: NextGIS */
|
|
2
2
|
var NgwLeaflet = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -22912,45 +22912,45 @@ var NgwLeaflet = (function () {
|
|
|
22912
22912
|
return CancelablePromise.resolve(undefined);
|
|
22913
22913
|
}
|
|
22914
22914
|
function featureLayerIdentify(options) {
|
|
22915
|
-
var geom = options.geom, signal = options.signal, cache = options.cache;
|
|
22916
|
-
var
|
|
22917
|
-
if (
|
|
22918
|
-
|
|
22915
|
+
var geom = options.geom, signal = options.signal, cache = options.cache, layers = options.layers;
|
|
22916
|
+
var wkt = typeof geom === 'string' ? geom : convertGeomToWKT(geom);
|
|
22917
|
+
if (!wkt) {
|
|
22918
|
+
throw new Error('Not valid geometry format to make intersection');
|
|
22919
22919
|
}
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22920
|
+
var data = {
|
|
22921
|
+
geom: wkt,
|
|
22922
|
+
srs: 3857,
|
|
22923
|
+
layers: layers,
|
|
22924
|
+
};
|
|
22925
|
+
return options.connector.post('feature_layer.identify', {
|
|
22926
|
+
data: data,
|
|
22927
|
+
signal: signal,
|
|
22928
|
+
cache: cache,
|
|
22929
|
+
});
|
|
22930
|
+
}
|
|
22931
|
+
function convertGeomToWKT(geom) {
|
|
22932
|
+
var coordinates = getPolygonCoordinates(geom);
|
|
22933
|
+
if (!coordinates)
|
|
22934
|
+
return null;
|
|
22935
|
+
var polygonStr = coordinates.map(function (_a) {
|
|
22936
|
+
var lng = _a[0], lat = _a[1];
|
|
22937
|
+
var _b = degrees2meters(lng, lat), x = _b[0], y = _b[1];
|
|
22938
|
+
return "".concat(x, " ").concat(y);
|
|
22939
|
+
});
|
|
22940
|
+
return "POLYGON((".concat(polygonStr.join(','), "))");
|
|
22941
|
+
}
|
|
22942
|
+
function getPolygonCoordinates(geom) {
|
|
22943
|
+
var _a;
|
|
22944
|
+
if (Array.isArray(geom)) {
|
|
22945
|
+
return geom;
|
|
22929
22946
|
}
|
|
22930
|
-
if (
|
|
22931
|
-
|
|
22932
|
-
var polygonStr = [];
|
|
22933
|
-
for (var _i = 0, geom_1 = geom_; _i < geom_1.length; _i++) {
|
|
22934
|
-
var _a = geom_1[_i], lng = _a[0], lat = _a[1];
|
|
22935
|
-
var _b = degrees2meters(lng, lat), x = _b[0], y = _b[1];
|
|
22936
|
-
polygonStr.push(x + ' ' + y);
|
|
22937
|
-
}
|
|
22938
|
-
var wkt = "POLYGON((".concat(polygonStr.join(', '), "))");
|
|
22939
|
-
var layers = options.layers;
|
|
22940
|
-
var data = {
|
|
22941
|
-
geom: wkt,
|
|
22942
|
-
srs: 3857,
|
|
22943
|
-
layers: layers,
|
|
22944
|
-
};
|
|
22945
|
-
return options.connector.post('feature_layer.identify', {
|
|
22946
|
-
data: data,
|
|
22947
|
-
signal: signal,
|
|
22948
|
-
cache: cache,
|
|
22949
|
-
});
|
|
22947
|
+
if (geom.type === 'Feature') {
|
|
22948
|
+
return (_a = geom.geometry) === null || _a === void 0 ? void 0 : _a.coordinates[0];
|
|
22950
22949
|
}
|
|
22951
|
-
|
|
22952
|
-
|
|
22950
|
+
if (geom.type === 'Polygon') {
|
|
22951
|
+
return geom.coordinates[0];
|
|
22953
22952
|
}
|
|
22953
|
+
return null;
|
|
22954
22954
|
}
|
|
22955
22955
|
function sendIdentifyRequest(ev, options) {
|
|
22956
22956
|
deprecatedMapClick(ev);
|