@nextgis/ngw-leaflet 2.5.4 → 2.5.5

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: 2.5.4; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.5.5; author: NextGIS */
2
2
  import 'leaflet/dist/leaflet.css';
3
3
  import LeafletMapAdapter from '@nextgis/leaflet-map-adapter';
4
4
  import { NgwMap } from '@nextgis/ngw-map';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.5.4; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.5.5; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -18370,7 +18370,7 @@ var NgwLeaflet = (function () {
18370
18370
 
18371
18371
  var pkg = {
18372
18372
  name: "@nextgis/ngw-connector",
18373
- version: "2.5.2",
18373
+ version: "2.5.5",
18374
18374
  _priority: 12,
18375
18375
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18376
18376
  main: "index.js",
@@ -18636,7 +18636,8 @@ var NgwLeaflet = (function () {
18636
18636
  }
18637
18637
  return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18638
18638
  serialization: "full"
18639
- }, query)).then((resources) => {
18639
+ }, query)).then((response) => {
18640
+ const resources = Array.isArray(response) ? response : response.items;
18640
18641
  if (resources) {
18641
18642
  for (const x of resources) {
18642
18643
  this.cache.add("resource.item", CancelablePromise.resolve(x), {
@@ -20806,9 +20807,9 @@ var NgwLeaflet = (function () {
20806
20807
  item
20807
20808
  }) {
20808
20809
  if (item.basemap_layer) {
20809
- const qms = item.basemap_layer.qms;
20810
- const url = item.basemap_layer.url;
20811
- if (qms) {
20810
+ const basemap = item.basemap_layer;
20811
+ const { qms, url } = basemap;
20812
+ if (qms && typeof qms === "string") {
20812
20813
  const qms_ = JSON.parse(qms);
20813
20814
  const adapter = Promise.resolve(
20814
20815
  QmsKit.utils.createQmsAdapter(webMap, void 0, {
@@ -20821,9 +20822,18 @@ var NgwLeaflet = (function () {
20821
20822
  const TileAdapter = webMap.mapAdapter.layerAdapters.TILE;
20822
20823
  if (TileAdapter) {
20823
20824
  class BasemapTileAdapter extends TileAdapter {
20825
+ constructor(map, options) {
20826
+ super(map, __spreadProps$c(__spreadValues$g({}, options), { baselayer: true, order: 0 }));
20827
+ }
20824
20828
  addLayer(opt) {
20825
20829
  return __async$g(this, null, function* () {
20826
- return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), { url }));
20830
+ var _a, _b, _c;
20831
+ return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), {
20832
+ url,
20833
+ minZoom: (_a = basemap.z_min) != null ? _a : opt.minZoom,
20834
+ maxZoom: (_b = basemap.z_max) != null ? _b : opt.maxZoom,
20835
+ attribution: (_c = basemap.copyright_text) != null ? _c : opt.attribution
20836
+ }));
20827
20837
  });
20828
20838
  }
20829
20839
  }