@nextgis/ngw-leaflet 2.5.3 → 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.3; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.5.5; author: NextGIS */
2
2
  function styleInject(css, ref) {
3
3
  if ( ref === void 0 ) ref = {};
4
4
  var insertAt = ref.insertAt;
@@ -17057,13 +17057,7 @@ class ImageLayer extends leafletSrcExports.Layer {
17057
17057
  constructor(url, options) {
17058
17058
  super(options);
17059
17059
  __publicField$C(this, "defaultWmsParams", {
17060
- service: "WMS",
17061
- request: "GetMap",
17062
- version: "1.1.1",
17063
- layers: "",
17064
- styles: "",
17065
- format: "image/jpeg",
17066
- transparent: false
17060
+ request: "GetMap"
17067
17061
  });
17068
17062
  __publicField$C(this, "options", {
17069
17063
  crs: null,
@@ -17220,9 +17214,7 @@ class ImageLayer extends leafletSrcExports.Layer {
17220
17214
  size.x = Math.ceil(size.x * factor);
17221
17215
  size.y = Math.ceil(size.y * factor);
17222
17216
  }
17223
- const wmsVersion = parseFloat(this.wmsParams.version);
17224
17217
  const crs = this.options.crs || map.options.crs;
17225
- const projectionKey = wmsVersion >= 1.3 ? "crs" : "srs";
17226
17218
  if (crs) {
17227
17219
  const nw = crs.project(bounds.getNorthWest());
17228
17220
  const se = crs.project(bounds.getSouthEast());
@@ -17230,8 +17222,7 @@ class ImageLayer extends leafletSrcExports.Layer {
17230
17222
  width: size.x,
17231
17223
  height: size.y
17232
17224
  };
17233
- params[projectionKey] = crs.code;
17234
- params.bbox = (wmsVersion >= 1.3 && crs === leafletSrcExports.CRS.EPSG4326 ? [se.y, nw.x, nw.y, se.x] : [nw.x, se.y, se.x, nw.y]).join(",");
17225
+ params.bbox = [nw.x, se.y, se.x, nw.y];
17235
17226
  leafletSrcExports.Util.extend(this.wmsParams, params);
17236
17227
  }
17237
17228
  }
@@ -18376,7 +18367,7 @@ let Cache = _Cache;
18376
18367
 
18377
18368
  var pkg = {
18378
18369
  name: "@nextgis/ngw-connector",
18379
- version: "2.5.2",
18370
+ version: "2.5.5",
18380
18371
  _priority: 12,
18381
18372
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18382
18373
  main: "index.js",
@@ -18642,7 +18633,8 @@ class ResourcesControl {
18642
18633
  }
18643
18634
  return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18644
18635
  serialization: "full"
18645
- }, query)).then((resources) => {
18636
+ }, query)).then((response) => {
18637
+ const resources = Array.isArray(response) ? response : response.items;
18646
18638
  if (resources) {
18647
18639
  for (const x of resources) {
18648
18640
  this.cache.add("resource.item", CancelablePromise.resolve(x), {
@@ -20812,9 +20804,9 @@ function createBasemapLayerAdapter(_0) {
20812
20804
  item
20813
20805
  }) {
20814
20806
  if (item.basemap_layer) {
20815
- const qms = item.basemap_layer.qms;
20816
- const url = item.basemap_layer.url;
20817
- if (qms) {
20807
+ const basemap = item.basemap_layer;
20808
+ const { qms, url } = basemap;
20809
+ if (qms && typeof qms === "string") {
20818
20810
  const qms_ = JSON.parse(qms);
20819
20811
  const adapter = Promise.resolve(
20820
20812
  QmsKit.utils.createQmsAdapter(webMap, void 0, {
@@ -20827,9 +20819,18 @@ function createBasemapLayerAdapter(_0) {
20827
20819
  const TileAdapter = webMap.mapAdapter.layerAdapters.TILE;
20828
20820
  if (TileAdapter) {
20829
20821
  class BasemapTileAdapter extends TileAdapter {
20822
+ constructor(map, options) {
20823
+ super(map, __spreadProps$c(__spreadValues$g({}, options), { baselayer: true, order: 0 }));
20824
+ }
20830
20825
  addLayer(opt) {
20831
20826
  return __async$g(this, null, function* () {
20832
- return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), { url }));
20827
+ var _a, _b, _c;
20828
+ return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), {
20829
+ url,
20830
+ minZoom: (_a = basemap.z_min) != null ? _a : opt.minZoom,
20831
+ maxZoom: (_b = basemap.z_max) != null ? _b : opt.maxZoom,
20832
+ attribution: (_c = basemap.copyright_text) != null ? _c : opt.attribution
20833
+ }));
20833
20834
  });
20834
20835
  }
20835
20836
  }