@nextgis/ngw-leaflet 1.18.11 → 1.18.12
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.12; author: NextGIS */
|
|
2
2
|
function styleInject(css, ref) {
|
|
3
3
|
if ( ref === void 0 ) ref = {};
|
|
4
4
|
var insertAt = ref.insertAt;
|
|
@@ -22014,44 +22014,44 @@ function fetchIdentifyItem(options) {
|
|
|
22014
22014
|
return CancelablePromise.resolve(undefined);
|
|
22015
22015
|
}
|
|
22016
22016
|
function featureLayerIdentify(options) {
|
|
22017
|
-
const { geom, signal, cache } = options;
|
|
22018
|
-
|
|
22017
|
+
const { geom, signal, cache, layers } = options;
|
|
22018
|
+
const wkt = typeof geom === 'string' ? geom : convertGeomToWKT(geom);
|
|
22019
|
+
if (!wkt) {
|
|
22020
|
+
throw new Error('Not valid geometry format to make intersection');
|
|
22021
|
+
}
|
|
22022
|
+
const data = {
|
|
22023
|
+
geom: wkt,
|
|
22024
|
+
srs: 3857,
|
|
22025
|
+
layers,
|
|
22026
|
+
};
|
|
22027
|
+
return options.connector.post('feature_layer.identify', {
|
|
22028
|
+
data,
|
|
22029
|
+
signal,
|
|
22030
|
+
cache,
|
|
22031
|
+
});
|
|
22032
|
+
}
|
|
22033
|
+
function convertGeomToWKT(geom) {
|
|
22034
|
+
const coordinates = getPolygonCoordinates(geom);
|
|
22035
|
+
if (!coordinates)
|
|
22036
|
+
return null;
|
|
22037
|
+
const polygonStr = coordinates.map(([lng, lat]) => {
|
|
22038
|
+
const [x, y] = degrees2meters(lng, lat);
|
|
22039
|
+
return `${x} ${y}`;
|
|
22040
|
+
});
|
|
22041
|
+
return `POLYGON((${polygonStr.join(',')}))`;
|
|
22042
|
+
}
|
|
22043
|
+
function getPolygonCoordinates(geom) {
|
|
22044
|
+
var _a;
|
|
22019
22045
|
if (Array.isArray(geom)) {
|
|
22020
|
-
|
|
22046
|
+
return geom;
|
|
22021
22047
|
}
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
? geom.geometry
|
|
22025
|
-
: geom.type === 'Polygon'
|
|
22026
|
-
? geom
|
|
22027
|
-
: false;
|
|
22028
|
-
if (polygon) {
|
|
22029
|
-
geom_ = polygon.coordinates[0];
|
|
22030
|
-
}
|
|
22031
|
-
}
|
|
22032
|
-
if (geom_) {
|
|
22033
|
-
// create wkt string
|
|
22034
|
-
const polygonStr = [];
|
|
22035
|
-
for (const [lng, lat] of geom_) {
|
|
22036
|
-
const [x, y] = degrees2meters(lng, lat);
|
|
22037
|
-
polygonStr.push(x + ' ' + y);
|
|
22038
|
-
}
|
|
22039
|
-
const wkt = `POLYGON((${polygonStr.join(', ')}))`;
|
|
22040
|
-
const layers = options.layers;
|
|
22041
|
-
const data = {
|
|
22042
|
-
geom: wkt,
|
|
22043
|
-
srs: 3857,
|
|
22044
|
-
layers,
|
|
22045
|
-
};
|
|
22046
|
-
return options.connector.post('feature_layer.identify', {
|
|
22047
|
-
data,
|
|
22048
|
-
signal,
|
|
22049
|
-
cache,
|
|
22050
|
-
});
|
|
22048
|
+
if (geom.type === 'Feature') {
|
|
22049
|
+
return (_a = geom.geometry) === null || _a === void 0 ? void 0 : _a.coordinates[0];
|
|
22051
22050
|
}
|
|
22052
|
-
|
|
22053
|
-
|
|
22051
|
+
if (geom.type === 'Polygon') {
|
|
22052
|
+
return geom.coordinates[0];
|
|
22054
22053
|
}
|
|
22054
|
+
return null;
|
|
22055
22055
|
}
|
|
22056
22056
|
function sendIdentifyRequest(ev, options) {
|
|
22057
22057
|
deprecatedMapClick(ev);
|