@nextgis/ngw-map 1.18.1 → 1.18.2

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 1.18.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 1.18.2; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 1.18.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 1.18.2; author: NextGIS */
2
2
  var events = {exports: {}};
3
3
 
4
4
  var R = typeof Reflect === 'object' ? Reflect : null;
@@ -8061,21 +8061,23 @@ function insertSvg(svg) {
8061
8061
  return oDOM.documentElement;
8062
8062
  }
8063
8063
  function getIcon(opt = {}) {
8064
- var _a, _b, _c, _d;
8064
+ var _a, _b, _c, _d, _e;
8065
8065
  // default values
8066
8066
  const shape = (_a = opt.shape) !== null && _a !== void 0 ? _a : 'circle';
8067
8067
  const color = (_b = opt.color) !== null && _b !== void 0 ? _b : 'blue';
8068
8068
  const strokeColor = (_c = opt.strokeColor) !== null && _c !== void 0 ? _c : 'white';
8069
8069
  const size = (_d = opt.size) !== null && _d !== void 0 ? _d : 12;
8070
+ const rotate = (_e = opt.rotate) !== null && _e !== void 0 ? _e : 0;
8070
8071
  const anchor = size / 2;
8071
8072
  const defSize = 12;
8072
- const stroke = typeof opt.stroke === 'number' ? opt.stroke : STROKE;
8073
+ const stroke = opt.stroke !== undefined ? Number(opt.stroke) : STROKE;
8073
8074
  const scale = size / defSize;
8074
8075
  const pathAlias = opt.p || svgPath[shape] || 'circle';
8075
8076
  const path = typeof pathAlias === 'string' ? pathAlias : pathAlias(opt);
8076
8077
  const svg = insertSvg(opt.svg || generateSvg(size, size, stroke * scale, path));
8077
8078
  const fistChild = svg.firstChild;
8078
- const transform = `scale(${scale})`;
8079
+ const scaledAnchor = defSize / 2;
8080
+ const transform = `scale(${scale}) rotate(${rotate}, ${scaledAnchor}, ${scaledAnchor})`;
8079
8081
  fistChild.setAttribute('fill', color);
8080
8082
  if (stroke) {
8081
8083
  fistChild.setAttribute('stroke', strokeColor);