@nextgis/ngw-map 1.18.3 → 1.18.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ngw-map.cjs.js +1 -1
- package/lib/ngw-map.esm-browser.js +36 -22
- package/lib/ngw-map.esm-browser.js.map +1 -1
- package/lib/ngw-map.esm-browser.prod.js +1 -1
- package/lib/ngw-map.esm-browser.prod.js.map +1 -1
- package/lib/ngw-map.esm-bundler.js +1 -1
- package/lib/ngw-map.global.js +37 -23
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +7 -7
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 1.18.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 1.18.9; author: NextGIS */
|
|
2
2
|
var events = {exports: {}};
|
|
3
3
|
|
|
4
4
|
var R = typeof Reflect === 'object' ? Reflect : null;
|
|
@@ -4979,8 +4979,9 @@ class NgwConnector$1 {
|
|
|
4979
4979
|
* ```
|
|
4980
4980
|
*/
|
|
4981
4981
|
apiRequest(name, params_ = {}, requestOptions = {}) {
|
|
4982
|
-
var _a;
|
|
4982
|
+
var _a, _b;
|
|
4983
4983
|
const { method, headers, withCredentials, responseType } = requestOptions;
|
|
4984
|
+
params_ = (_a = requestOptions.params) !== null && _a !== void 0 ? _a : params_;
|
|
4984
4985
|
const params = objectRemoveEmpty(params_);
|
|
4985
4986
|
const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
|
|
4986
4987
|
if (requestOptions.cache && method === 'GET') {
|
|
@@ -4992,7 +4993,7 @@ class NgwConnector$1 {
|
|
|
4992
4993
|
withCredentials,
|
|
4993
4994
|
responseType,
|
|
4994
4995
|
baseUrl: this.options.baseUrl,
|
|
4995
|
-
userId: (
|
|
4996
|
+
userId: (_b = this.user) === null || _b === void 0 ? void 0 : _b.id,
|
|
4996
4997
|
}),
|
|
4997
4998
|
});
|
|
4998
4999
|
}
|
|
@@ -5432,8 +5433,11 @@ function createGeoJsonFeature(item) {
|
|
|
5432
5433
|
}
|
|
5433
5434
|
function updateItemRequestParam(params, options) {
|
|
5434
5435
|
const { extensions, geom, fields, srs, ilike, like } = options;
|
|
5435
|
-
|
|
5436
|
-
|
|
5436
|
+
// Empty extesions by default
|
|
5437
|
+
let extensionsStr = extensions ? extensions.join(',') : '';
|
|
5438
|
+
// Use character * to set all extensions
|
|
5439
|
+
if (extensionsStr !== '*') {
|
|
5440
|
+
params.extensions = extensionsStr;
|
|
5437
5441
|
}
|
|
5438
5442
|
if (fields !== undefined) {
|
|
5439
5443
|
params.fields = Array.isArray(fields) ? fields.join(',') : '';
|
|
@@ -8051,15 +8055,16 @@ const svgPath = {
|
|
|
8051
8055
|
minus: '<path d="m12 7.5v-3h-12v3z"/>',
|
|
8052
8056
|
asterisk: '<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>',
|
|
8053
8057
|
};
|
|
8058
|
+
const VIEW_BOX = 12;
|
|
8054
8059
|
const STROKE = 0.8;
|
|
8055
|
-
function generateSvg(width, height, stroke = 0, content) {
|
|
8060
|
+
function generateSvg({ width, height, stroke = 0, content, }) {
|
|
8056
8061
|
const s = stroke / 2;
|
|
8057
8062
|
const svg = `<svg
|
|
8058
8063
|
version="1.1"
|
|
8059
8064
|
xmlns="http://www.w3.org/2000/svg"
|
|
8060
8065
|
width="${width}"
|
|
8061
8066
|
height="${height}"
|
|
8062
|
-
viewBox="-${s} -${s} ${
|
|
8067
|
+
viewBox="-${s} -${s} ${VIEW_BOX + stroke} ${VIEW_BOX + stroke}"
|
|
8063
8068
|
>${content}</svg>`;
|
|
8064
8069
|
return svg;
|
|
8065
8070
|
}
|
|
@@ -8068,36 +8073,45 @@ function insertSvg(svg) {
|
|
|
8068
8073
|
const oDOM = oParser.parseFromString(svg, 'image/svg+xml');
|
|
8069
8074
|
return oDOM.documentElement;
|
|
8070
8075
|
}
|
|
8076
|
+
/**
|
|
8077
|
+
* Retrieves an icon with the provided options.
|
|
8078
|
+
* @function
|
|
8079
|
+
* @param {IconOptions} [opt={}] - Options for the icon.
|
|
8080
|
+
* @returns {IconPaint} Icon paint object.
|
|
8081
|
+
*/
|
|
8071
8082
|
function getIcon(opt = {}) {
|
|
8072
|
-
var _a, _b, _c, _d, _e;
|
|
8073
|
-
//
|
|
8083
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8084
|
+
// Default values
|
|
8074
8085
|
const shape = (_a = opt.shape) !== null && _a !== void 0 ? _a : 'circle';
|
|
8075
8086
|
const color = (_b = opt.color) !== null && _b !== void 0 ? _b : 'blue';
|
|
8076
8087
|
const strokeColor = (_c = opt.strokeColor) !== null && _c !== void 0 ? _c : 'white';
|
|
8077
|
-
const size = (_d = opt.size) !== null && _d !== void 0 ? _d :
|
|
8088
|
+
const size = (_d = opt.size) !== null && _d !== void 0 ? _d : VIEW_BOX;
|
|
8078
8089
|
const rotate = (_e = opt.rotate) !== null && _e !== void 0 ? _e : 0;
|
|
8079
|
-
const anchor = size / 2;
|
|
8080
|
-
const defSize = 12;
|
|
8090
|
+
const anchor = (_f = opt.anchor) !== null && _f !== void 0 ? _f : [size / 2, size / 2];
|
|
8081
8091
|
const stroke = opt.stroke !== undefined ? Number(opt.stroke) : STROKE;
|
|
8082
|
-
const scale = size / defSize;
|
|
8083
8092
|
const pathAlias = opt.p || svgPath[shape] || 'circle';
|
|
8084
8093
|
const path = typeof pathAlias === 'string' ? pathAlias : pathAlias(opt);
|
|
8085
|
-
const svg = insertSvg(opt.svg ||
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8094
|
+
const svg = insertSvg(opt.svg ||
|
|
8095
|
+
generateSvg({
|
|
8096
|
+
width: size,
|
|
8097
|
+
height: size,
|
|
8098
|
+
stroke,
|
|
8099
|
+
content: path,
|
|
8100
|
+
}));
|
|
8101
|
+
svg.setAttribute('width', String(size));
|
|
8102
|
+
svg.setAttribute('height', String(size));
|
|
8103
|
+
svg.setAttribute('fill', color);
|
|
8090
8104
|
if (stroke) {
|
|
8091
|
-
|
|
8092
|
-
|
|
8105
|
+
svg.setAttribute('stroke', strokeColor);
|
|
8106
|
+
svg.setAttribute('stroke-width', String(stroke));
|
|
8093
8107
|
}
|
|
8094
|
-
fistChild.setAttribute('transform', transform);
|
|
8095
8108
|
const s = new XMLSerializer();
|
|
8096
8109
|
return {
|
|
8097
8110
|
type: 'icon',
|
|
8098
8111
|
iconSize: [size, size],
|
|
8099
|
-
iconAnchor:
|
|
8112
|
+
iconAnchor: anchor,
|
|
8100
8113
|
html: s.serializeToString(svg),
|
|
8114
|
+
rotate,
|
|
8101
8115
|
svg,
|
|
8102
8116
|
};
|
|
8103
8117
|
}
|