@nextgis/ngw-leaflet 1.8.0 → 1.8.4

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-leaflet; version: 1.8.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 1.8.4; author: NextGIS */
2
2
  import 'leaflet/dist/leaflet.css';
3
3
  import { Icon } from 'leaflet';
4
4
  import { NgwMap } from '@nextgis/ngw-map';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 1.8.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 1.8.4; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -16943,7 +16943,7 @@ var NgwLeaflet = (function () {
16943
16943
  this._emitLayerEvent(preEventName, id, l);
16944
16944
  this._emitLayerEvent('layer:pretoggle', id, l);
16945
16945
  }
16946
- if (!(toStatus && this.mapAdapter)) return [3 /*break*/, 5];
16946
+ if (!(toStatus && this.mapAdapter)) return [3 /*break*/, 9];
16947
16947
  order = l.options.baselayer ? 0 : l.options.order;
16948
16948
  if (!(l.options.baselayer && this._baselayers.length)) return [3 /*break*/, 4];
16949
16949
  anotherVisibleBaselayers = this._baselayers.filter(function (x) {
@@ -16962,25 +16962,35 @@ var NgwLeaflet = (function () {
16962
16962
  _i++;
16963
16963
  return [3 /*break*/, 1];
16964
16964
  case 4:
16965
- if (l.showLayer) {
16966
- l.showLayer.call(l, l.layer);
16967
- }
16968
- else if (l.layer !== undefined) {
16969
- this.mapAdapter.showLayer(l.layer);
16970
- }
16965
+ if (!l.showLayer) return [3 /*break*/, 6];
16966
+ return [4 /*yield*/, l.showLayer.call(l, l.layer)];
16967
+ case 5:
16968
+ _a.sent();
16969
+ return [3 /*break*/, 8];
16970
+ case 6:
16971
+ if (!(l.layer !== undefined)) return [3 /*break*/, 8];
16972
+ return [4 /*yield*/, this.mapAdapter.showLayer(l.layer)];
16973
+ case 7:
16974
+ _a.sent();
16975
+ _a.label = 8;
16976
+ case 8:
16971
16977
  if (order !== undefined) {
16972
16978
  this.mapAdapter.setLayerOrder(l.layer, order, this._layers);
16973
16979
  }
16974
- return [3 /*break*/, 6];
16975
- case 5:
16976
- if (l.hideLayer) {
16977
- l.hideLayer.call(l, l.layer);
16978
- }
16979
- else if (l.layer !== undefined) {
16980
- this.mapAdapter.hideLayer(l.layer);
16981
- }
16982
- _a.label = 6;
16983
- case 6:
16980
+ return [3 /*break*/, 13];
16981
+ case 9:
16982
+ if (!l.hideLayer) return [3 /*break*/, 11];
16983
+ return [4 /*yield*/, l.hideLayer.call(l, l.layer)];
16984
+ case 10:
16985
+ _a.sent();
16986
+ return [3 /*break*/, 13];
16987
+ case 11:
16988
+ if (!(l.layer !== undefined)) return [3 /*break*/, 13];
16989
+ return [4 /*yield*/, this.mapAdapter.hideLayer(l.layer)];
16990
+ case 12:
16991
+ _a.sent();
16992
+ _a.label = 13;
16993
+ case 13:
16984
16994
  if (!silent) {
16985
16995
  this._emitLayerEvent(eventName, id, l);
16986
16996
  this._emitLayerEvent('layer:toggle', id, l);
@@ -16996,16 +17006,19 @@ var NgwLeaflet = (function () {
16996
17006
  return Promise.resolve();
16997
17007
  };
16998
17008
  WebMapLayers.prototype.updateLayer = function (layerDef) {
17009
+ var _this = this;
16999
17010
  var layer = this.getLayer(layerDef);
17000
17011
  if (layer) {
17001
17012
  if (layer.updateLayer) {
17002
- layer.updateLayer();
17013
+ return Promise.resolve(layer.updateLayer());
17003
17014
  }
17004
17015
  else if (this.isLayerVisible(layer)) {
17005
- this.hideLayer(layer, { silent: true });
17006
- this.showLayer(layer, { silent: true });
17016
+ return this.hideLayer(layer, { silent: true }).then(function () {
17017
+ return _this.showLayer(layer, { silent: true });
17018
+ });
17007
17019
  }
17008
17020
  }
17021
+ return Promise.resolve();
17009
17022
  };
17010
17023
  /**
17011
17024
  * Set transparency for a given layer by number from 0 to 1
@@ -19864,6 +19877,9 @@ var NgwLeaflet = (function () {
19864
19877
  BaseProperty.prototype.getParent = function () {
19865
19878
  return this.item.tree.getParent();
19866
19879
  };
19880
+ BaseProperty.prototype.getChildren = function () {
19881
+ return this.item.tree.getChildren();
19882
+ };
19867
19883
  BaseProperty.prototype.isGroup = function () {
19868
19884
  var children = this.item.tree.getDescendants();
19869
19885
  return children.length;
@@ -19984,6 +20000,26 @@ var NgwLeaflet = (function () {
19984
20000
  return property && property.get();
19985
20001
  }));
19986
20002
  };
20003
+ CheckProperty.prototype.block = function (options) {
20004
+ this._blocked = true;
20005
+ this._block(options);
20006
+ };
20007
+ CheckProperty.prototype.unBlock = function (options) {
20008
+ this._blocked = false;
20009
+ if (this.getValue()) {
20010
+ this._unBlock(options);
20011
+ }
20012
+ };
20013
+ CheckProperty.prototype.blockChild = function (options) {
20014
+ var _this = this;
20015
+ this.item.tree
20016
+ .getDescendants()
20017
+ .forEach(function (x) { return _this._blockChild(x, options); });
20018
+ };
20019
+ CheckProperty.prototype.unblockChild = function (options) {
20020
+ var _this = this;
20021
+ this.item.tree.getChildren().forEach(function (x) { return _this._unBlockChild(x, options); });
20022
+ };
19987
20023
  CheckProperty.prototype._prepareValue = function (value) {
19988
20024
  return value;
19989
20025
  };
@@ -20005,32 +20041,12 @@ var NgwLeaflet = (function () {
20005
20041
  this.unblockChild(options);
20006
20042
  }
20007
20043
  };
20008
- CheckProperty.prototype.block = function (options) {
20009
- this._blocked = true;
20010
- this._block(options);
20011
- };
20012
20044
  CheckProperty.prototype._block = function (options) {
20013
20045
  this._turnOff(options);
20014
20046
  };
20015
- CheckProperty.prototype.unBlock = function (options) {
20016
- this._blocked = false;
20017
- if (this.getValue()) {
20018
- this._unBlock(options);
20019
- }
20020
- };
20021
20047
  CheckProperty.prototype._unBlock = function (options) {
20022
20048
  this._turnOn(options);
20023
20049
  };
20024
- CheckProperty.prototype.blockChild = function (options) {
20025
- var _this = this;
20026
- this.item.tree
20027
- .getDescendants()
20028
- .forEach(function (x) { return _this._blockChild(x, options); });
20029
- };
20030
- CheckProperty.prototype.unblockChild = function (options) {
20031
- var _this = this;
20032
- this.item.tree.getChildren().forEach(function (x) { return _this._unBlockChild(x, options); });
20033
- };
20034
20050
  CheckProperty.prototype._blockChild = function (item, options) {
20035
20051
  var prop = item.properties &&
20036
20052
  item.properties.property(this.name);
@@ -20086,22 +20102,22 @@ var NgwLeaflet = (function () {
20086
20102
  };
20087
20103
  ItemProperties.prototype._setPropertyHandler = function (propOpt) {
20088
20104
  var handlers = ItemProperties.handlers;
20089
- var handler = propOpt.handler;
20090
- if (!handler && propOpt.type) {
20105
+ var Handler = propOpt.handler;
20106
+ if (!Handler && propOpt.type) {
20091
20107
  switch (propOpt.type) {
20092
20108
  case 'boolean':
20093
- handler = handlers.CheckProperty;
20109
+ Handler = handlers.CheckProperty;
20094
20110
  break;
20095
20111
  case 'string':
20096
- handler = handlers.BaseProperty;
20112
+ Handler = handlers.BaseProperty;
20097
20113
  break;
20098
20114
  default:
20099
- handler = handlers.BaseProperty;
20115
+ Handler = handlers.BaseProperty;
20100
20116
  }
20101
20117
  }
20102
- if (handler && propOpt.name) {
20118
+ if (Handler && propOpt.name) {
20103
20119
  var options = __assign({}, (propOpt || {}));
20104
- this._properties[propOpt.name] = new handler(propOpt.name, this.item, options);
20120
+ this._properties[propOpt.name] = new Handler(propOpt.name, this.item, options);
20105
20121
  this._propertiesList.push(propOpt.name);
20106
20122
  }
20107
20123
  };
@@ -20160,6 +20176,62 @@ var NgwLeaflet = (function () {
20160
20176
  return Item;
20161
20177
  }());
20162
20178
 
20179
+ var WebmapLayerOpacityPropertyHandler = /** @class */ (function (_super) {
20180
+ __extends(WebmapLayerOpacityPropertyHandler, _super);
20181
+ function WebmapLayerOpacityPropertyHandler() {
20182
+ return _super !== null && _super.apply(this, arguments) || this;
20183
+ }
20184
+ WebmapLayerOpacityPropertyHandler.prototype.getProperty = function () {
20185
+ var layer = this.item.layer;
20186
+ if (layer) {
20187
+ return layer && layer.options && layer.options.opacity !== undefined
20188
+ ? layer.options.opacity
20189
+ : 1;
20190
+ }
20191
+ return 1;
20192
+ };
20193
+ WebmapLayerOpacityPropertyHandler.prototype.update = function (value, options) {
20194
+ var _this = this;
20195
+ options = options || {};
20196
+ if (this.isGroup()) {
20197
+ this._value = this._prepareValue(value, options);
20198
+ var children = this.getChildren();
20199
+ for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
20200
+ var child = children_1[_i];
20201
+ var property = child.properties.property(this.name);
20202
+ if (property) {
20203
+ if (options.propagation) {
20204
+ property.set(value, options);
20205
+ }
20206
+ else {
20207
+ property.update(property.get(), options);
20208
+ }
20209
+ }
20210
+ }
20211
+ }
20212
+ var layer = this.item.layer;
20213
+ if (layer) {
20214
+ var parents = this.getParents();
20215
+ var coef = parents.reduce(function (s, x) {
20216
+ var prop = x.properties.property(_this.name);
20217
+ var multiplier = prop ? prop.getValue() : 1;
20218
+ return s * multiplier;
20219
+ }, 1);
20220
+ var val = value * coef;
20221
+ this.item.webMap.setLayerOpacity(layer, this._prepareValue(val));
20222
+ }
20223
+ };
20224
+ WebmapLayerOpacityPropertyHandler.prototype._prepareValue = function (value, options) {
20225
+ if (options && options.propagation && this.isGroup()) {
20226
+ return 1;
20227
+ }
20228
+ // value = Number(value);
20229
+ // return value < 0.1 ? 0.1 : value;
20230
+ return Number(value);
20231
+ };
20232
+ return WebmapLayerOpacityPropertyHandler;
20233
+ }(BaseProperty));
20234
+
20163
20235
  var NgwWebmapItem = /** @class */ (function (_super) {
20164
20236
  __extends(NgwWebmapItem, _super);
20165
20237
  function NgwWebmapItem(webMap, item, options, connector, parent, noInit) {
@@ -20254,6 +20326,9 @@ var NgwLeaflet = (function () {
20254
20326
  NgwWebmapItem.prototype.fit = function () {
20255
20327
  if (this.item.item_type === 'layer') ;
20256
20328
  };
20329
+ NgwWebmapItem.prototype.getLayer = function () {
20330
+ return this.layer;
20331
+ };
20257
20332
  NgwWebmapItem.prototype.getItemOptions = function (item) {
20258
20333
  var transparency = item.item_type === 'layer' && item.layer_transparency;
20259
20334
  var opacity = typeof transparency === 'number' ? (100 - transparency) / 100 : undefined;
@@ -20274,12 +20349,7 @@ var NgwLeaflet = (function () {
20274
20349
  options.order = Number((this.options.order | 0) + '.' + subLevel);
20275
20350
  }
20276
20351
  if (item.item_type === 'layer') {
20277
- var maxZoom = item.layer_max_scale_denom
20278
- ? this._mapScaleToZoomLevel(item.layer_max_scale_denom)
20279
- : this.webMap.options.maxZoom;
20280
- var minZoom = item.layer_min_scale_denom
20281
- ? this._mapScaleToZoomLevel(item.layer_min_scale_denom)
20282
- : this.webMap.options.minZoom;
20352
+ var _a = this._getZoomRange(item), maxZoom = _a.maxZoom, minZoom = _a.minZoom;
20283
20353
  objectAssign(options, {
20284
20354
  updateWmsParams: item.updateWmsParams,
20285
20355
  url: item.url,
@@ -20302,6 +20372,23 @@ var NgwLeaflet = (function () {
20302
20372
  NgwWebmapItem.prototype._mapScaleToZoomLevel = function (scale) {
20303
20373
  return setScaleRatio(scale);
20304
20374
  };
20375
+ NgwWebmapItem.prototype._getZoomRange = function (item) {
20376
+ var minZoomMap = this.webMap.options.minZoom;
20377
+ var maxZoomMap = this.webMap.options.maxZoom;
20378
+ var minZoomWebmap = this.options.minZoom;
20379
+ var maxZoomWebmap = this.options.maxZoom;
20380
+ var minZoomLayer = item.layer_min_scale_denom
20381
+ ? this._mapScaleToZoomLevel(item.layer_min_scale_denom)
20382
+ : undefined;
20383
+ var maxZoomLayer = item.layer_max_scale_denom
20384
+ ? this._mapScaleToZoomLevel(item.layer_max_scale_denom)
20385
+ : undefined;
20386
+ var minZooms = [minZoomMap, minZoomWebmap, minZoomLayer].filter(Boolean);
20387
+ var maxZooms = [maxZoomMap, maxZoomWebmap, maxZoomLayer].filter(Boolean);
20388
+ var minZoom = Math.max.apply(Math, minZooms);
20389
+ var maxZoom = Math.min.apply(Math, maxZooms);
20390
+ return { minZoom: minZoom, maxZoom: maxZoom };
20391
+ };
20305
20392
  NgwWebmapItem.prototype._init = function (item) {
20306
20393
  var _this = this;
20307
20394
  this.initItem(item).then(function () {
@@ -20357,6 +20444,10 @@ var NgwLeaflet = (function () {
20357
20444
  }
20358
20445
  },
20359
20446
  },
20447
+ {
20448
+ name: 'opacity',
20449
+ handler: WebmapLayerOpacityPropertyHandler,
20450
+ },
20360
20451
  ],
20361
20452
  };
20362
20453
  return NgwWebmapItem;
@@ -20385,15 +20476,59 @@ var NgwLeaflet = (function () {
20385
20476
  return this._removed;
20386
20477
  };
20387
20478
  OnFirstShowAdapter.prototype.showLayer = function () {
20388
- this.options.visibility = true;
20389
- if (this.layer.length) {
20390
- this.layer.forEach(function (x) {
20391
- webMap.showLayer(x);
20479
+ return __awaiter(this, void 0, void 0, function () {
20480
+ var _i, _a, x;
20481
+ return __generator(this, function (_b) {
20482
+ switch (_b.label) {
20483
+ case 0:
20484
+ this.options.visibility = true;
20485
+ if (!this.layer.length) return [3 /*break*/, 5];
20486
+ _i = 0, _a = this.layer;
20487
+ _b.label = 1;
20488
+ case 1:
20489
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
20490
+ x = _a[_i];
20491
+ return [4 /*yield*/, webMap.showLayer(x)];
20492
+ case 2:
20493
+ _b.sent();
20494
+ _b.label = 3;
20495
+ case 3:
20496
+ _i++;
20497
+ return [3 /*break*/, 1];
20498
+ case 4: return [3 /*break*/, 7];
20499
+ case 5: return [4 /*yield*/, this.loadLayer()];
20500
+ case 6:
20501
+ _b.sent();
20502
+ _b.label = 7;
20503
+ case 7: return [2 /*return*/];
20504
+ }
20392
20505
  });
20393
- }
20394
- else {
20395
- this.loadLayer();
20396
- }
20506
+ });
20507
+ };
20508
+ OnFirstShowAdapter.prototype.hideLayer = function () {
20509
+ return __awaiter(this, void 0, void 0, function () {
20510
+ var _i, _a, x;
20511
+ return __generator(this, function (_b) {
20512
+ switch (_b.label) {
20513
+ case 0:
20514
+ this.options.visibility = false;
20515
+ if (!this.layer) return [3 /*break*/, 4];
20516
+ _i = 0, _a = this.layer;
20517
+ _b.label = 1;
20518
+ case 1:
20519
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
20520
+ x = _a[_i];
20521
+ return [4 /*yield*/, webMap.hideLayer(x)];
20522
+ case 2:
20523
+ _b.sent();
20524
+ _b.label = 3;
20525
+ case 3:
20526
+ _i++;
20527
+ return [3 /*break*/, 1];
20528
+ case 4: return [2 /*return*/];
20529
+ }
20530
+ });
20531
+ });
20397
20532
  };
20398
20533
  OnFirstShowAdapter.prototype.loadLayer = function () {
20399
20534
  return __awaiter(this, void 0, void 0, function () {
@@ -20423,13 +20558,13 @@ var NgwLeaflet = (function () {
20423
20558
  if (this._removed) {
20424
20559
  webMap.removeLayer(adapter);
20425
20560
  }
20561
+ this.layer.push(adapter);
20426
20562
  if (!this.options.visibility) return [3 /*break*/, 4];
20427
20563
  return [4 /*yield*/, webMap.showLayer(adapter)];
20428
20564
  case 3:
20429
20565
  _a.sent();
20430
20566
  _a.label = 4;
20431
20567
  case 4:
20432
- this.layer.push(adapter);
20433
20568
  this._creatingInProgress = false;
20434
20569
  _a.label = 5;
20435
20570
  case 5: return [2 /*return*/, this.layer];
@@ -20437,12 +20572,6 @@ var NgwLeaflet = (function () {
20437
20572
  });
20438
20573
  });
20439
20574
  };
20440
- OnFirstShowAdapter.prototype.hideLayer = function () {
20441
- this.options.visibility = false;
20442
- if (this.layer) {
20443
- this.layer.forEach(function (x) { return webMap.hideLayer(x); });
20444
- }
20445
- };
20446
20575
  return OnFirstShowAdapter;
20447
20576
  }());
20448
20577
  return [2 /*return*/, OnFirstShowAdapter];
@@ -20585,14 +20714,34 @@ var NgwLeaflet = (function () {
20585
20714
  delete this._webmapLayersIds;
20586
20715
  };
20587
20716
  NgwWebmapLayerAdapter.prototype.showLayer = function () {
20588
- if (this.layer && this.layer.properties) {
20589
- this.layer.properties.property('visibility').set(true);
20590
- }
20717
+ return __awaiter(this, void 0, void 0, function () {
20718
+ return __generator(this, function (_a) {
20719
+ if (this.layer && this.layer.properties) {
20720
+ return [2 /*return*/, this.layer.properties.property('visibility').set(true)];
20721
+ }
20722
+ return [2 /*return*/];
20723
+ });
20724
+ });
20591
20725
  };
20592
20726
  NgwWebmapLayerAdapter.prototype.hideLayer = function () {
20593
- if (this.layer && this.layer.properties) {
20594
- this.layer.properties.property('visibility').set(false);
20595
- }
20727
+ return __awaiter(this, void 0, void 0, function () {
20728
+ return __generator(this, function (_a) {
20729
+ if (this.layer && this.layer.properties) {
20730
+ return [2 /*return*/, this.layer.properties.property('visibility').set(false)];
20731
+ }
20732
+ return [2 /*return*/];
20733
+ });
20734
+ });
20735
+ };
20736
+ NgwWebmapLayerAdapter.prototype.setOpacity = function (val) {
20737
+ return __awaiter(this, void 0, void 0, function () {
20738
+ return __generator(this, function (_a) {
20739
+ if (this.layer && this.layer.properties) {
20740
+ return [2 /*return*/, this.layer.properties.property('opacity').set(val)];
20741
+ }
20742
+ return [2 /*return*/];
20743
+ });
20744
+ });
20596
20745
  };
20597
20746
  /** @deprecated use {@link NgwWebmapLayerAdapter.getBounds} instead */
20598
20747
  NgwWebmapLayerAdapter.prototype.getExtent = function () {
@@ -20703,6 +20852,8 @@ var NgwLeaflet = (function () {
20703
20852
  options.order = _this.options.order;
20704
20853
  options.ratio = _this.options.ratio;
20705
20854
  options.crossOrigin = _this.options.crossOrigin;
20855
+ options.minZoom = _this.options.minZoom;
20856
+ options.maxZoom = _this.options.maxZoom;
20706
20857
  options.drawOrderEnabled = webmap_1.draw_order_enabled;
20707
20858
  var layer = new _this.NgwWebmapItem(_this.options.webMap, webmap_1.root_item, options, _this.options.connector);
20708
20859
  layer.emitter.on('init', function () { return resolve(layer); });
@@ -22863,7 +23014,9 @@ var NgwLeaflet = (function () {
22863
23014
  GeoJsonAdapter.prototype.getBounds = function () {
22864
23015
  if (this.layer) {
22865
23016
  var bounds = this.layer.getBounds();
22866
- return boundsToArray(bounds);
23017
+ if (bounds.isValid()) {
23018
+ return boundsToArray(bounds);
23019
+ }
22867
23020
  }
22868
23021
  };
22869
23022
  GeoJsonAdapter.prototype.setOpacity = function (value) {
@@ -22918,10 +23071,10 @@ var NgwLeaflet = (function () {
22918
23071
  var _a, _b;
22919
23072
  if (options === void 0) { options = {}; }
22920
23073
  return __awaiter(this, void 0, void 0, function () {
22921
- var feature, layer, _c, minWidth, autoPan, maxWidth, closeButton_, closeButton, popup, _closeHandlers, onClose, close, content, _d, unselectOnClose, p;
23074
+ var feature, layer, _c, minWidth, autoPan, maxWidth, closeButton_, closeButton, popup, _closeHandlers, onClose, close, content, popupOptions, unselectOnClose, p;
22922
23075
  var _this = this;
22923
- return __generator(this, function (_e) {
22924
- switch (_e.label) {
23076
+ return __generator(this, function (_d) {
23077
+ switch (_d.label) {
22925
23078
  case 0:
22926
23079
  feature = def.feature, layer = def.layer;
22927
23080
  _c = __assign({ minWidth: 300 }, options), minWidth = _c.minWidth, autoPan = _c.autoPan, maxWidth = _c.maxWidth, closeButton_ = _c.closeButton;
@@ -22938,22 +23091,25 @@ var NgwLeaflet = (function () {
22938
23091
  if (!options.createPopupContent) return [3 /*break*/, 2];
22939
23092
  return [4 /*yield*/, options.createPopupContent(__assign({ layer: layer, feature: feature, target: this, type: type, close: close, onClose: onClose }, createFeaturePositionOptions(feature)))];
22940
23093
  case 1:
22941
- _d = _e.sent();
23094
+ content = _d.sent();
22942
23095
  return [3 /*break*/, 3];
22943
23096
  case 2:
22944
- _d = options.popupContent;
22945
- _e.label = 3;
23097
+ content = options.popupContent;
23098
+ _d.label = 3;
22946
23099
  case 3:
22947
- content = _d;
22948
23100
  if (content && layer) {
22949
- popup = layer.bindPopup(content, {
23101
+ popupOptions = {
22950
23102
  minWidth: minWidth,
22951
23103
  autoPan: autoPan,
22952
- maxWidth: maxWidth,
23104
+ // maxWidth,
22953
23105
  closeButton: closeButton,
22954
23106
  closeOnClick: false,
22955
23107
  autoClose: false,
22956
- });
23108
+ };
23109
+ if (defined(maxWidth)) {
23110
+ popupOptions.maxWidth = maxWidth;
23111
+ }
23112
+ popup = layer.bindPopup(content, popupOptions);
22957
23113
  unselectOnClose = (_b = (_a = this.options.popupOptions) === null || _a === void 0 ? void 0 : _a.unselectOnClose) !== null && _b !== void 0 ? _b : true;
22958
23114
  if (unselectOnClose) {
22959
23115
  p = layer.getPopup();
@@ -22963,9 +23119,7 @@ var NgwLeaflet = (function () {
22963
23119
  }, this);
22964
23120
  }
22965
23121
  this._openedPopup.push([popup, _closeHandlers, def]);
22966
- setTimeout(function () {
22967
- popup.openPopup(latlng);
22968
- }, 0);
23122
+ popup.openPopup(latlng);
22969
23123
  }
22970
23124
  return [2 /*return*/];
22971
23125
  }
@@ -23998,5 +24152,5 @@ var NgwLeaflet = (function () {
23998
24152
 
23999
24153
  return NgwLeaflet;
24000
24154
 
24001
- }());
24155
+ })();
24002
24156
  //# sourceMappingURL=ngw-leaflet.global.js.map