@nextgis/ngw-leaflet 1.8.3 → 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.3; 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.3; 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
 
@@ -20349,12 +20349,7 @@ var NgwLeaflet = (function () {
20349
20349
  options.order = Number((this.options.order | 0) + '.' + subLevel);
20350
20350
  }
20351
20351
  if (item.item_type === 'layer') {
20352
- var maxZoom = item.layer_max_scale_denom
20353
- ? this._mapScaleToZoomLevel(item.layer_max_scale_denom)
20354
- : this.webMap.options.maxZoom;
20355
- var minZoom = item.layer_min_scale_denom
20356
- ? this._mapScaleToZoomLevel(item.layer_min_scale_denom)
20357
- : this.webMap.options.minZoom;
20352
+ var _a = this._getZoomRange(item), maxZoom = _a.maxZoom, minZoom = _a.minZoom;
20358
20353
  objectAssign(options, {
20359
20354
  updateWmsParams: item.updateWmsParams,
20360
20355
  url: item.url,
@@ -20377,6 +20372,23 @@ var NgwLeaflet = (function () {
20377
20372
  NgwWebmapItem.prototype._mapScaleToZoomLevel = function (scale) {
20378
20373
  return setScaleRatio(scale);
20379
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
+ };
20380
20392
  NgwWebmapItem.prototype._init = function (item) {
20381
20393
  var _this = this;
20382
20394
  this.initItem(item).then(function () {
@@ -20840,6 +20852,8 @@ var NgwLeaflet = (function () {
20840
20852
  options.order = _this.options.order;
20841
20853
  options.ratio = _this.options.ratio;
20842
20854
  options.crossOrigin = _this.options.crossOrigin;
20855
+ options.minZoom = _this.options.minZoom;
20856
+ options.maxZoom = _this.options.maxZoom;
20843
20857
  options.drawOrderEnabled = webmap_1.draw_order_enabled;
20844
20858
  var layer = new _this.NgwWebmapItem(_this.options.webMap, webmap_1.root_item, options, _this.options.connector);
20845
20859
  layer.emitter.on('init', function () { return resolve(layer); });