@nextgis/ngw-leaflet 2.3.0 → 2.4.0

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.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.4.0; 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.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.4.0; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -18510,7 +18510,10 @@ var NgwLeaflet = (function () {
18510
18510
  }
18511
18511
  return CancelablePromise.resolve(void 0);
18512
18512
  };
18513
- return cache.addFull("resource", makeRequest, forCache);
18513
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18514
+ return cache.addFull("resource", makeRequest, forCache);
18515
+ }
18516
+ return makeRequest();
18514
18517
  }
18515
18518
  getOneOrFail(resource, requestOptions) {
18516
18519
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18671,14 +18674,17 @@ var NgwLeaflet = (function () {
18671
18674
  }
18672
18675
  _fetchResourceById(id, requestOptions) {
18673
18676
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
18674
- return this.cache.add("resource.item", promise, {
18675
- id
18676
- }).catch((er) => {
18677
- if (!(er instanceof ResourceNotFoundError)) {
18678
- throw er;
18679
- }
18680
- return void 0;
18681
- });
18677
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18678
+ return this.cache.add("resource.item", promise, {
18679
+ id
18680
+ }).catch((er) => {
18681
+ if (!(er instanceof ResourceNotFoundError)) {
18682
+ throw er;
18683
+ }
18684
+ return void 0;
18685
+ });
18686
+ }
18687
+ return promise();
18682
18688
  }
18683
18689
  _fetchResourceBy(resource, requestOptions) {
18684
18690
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18758,7 +18764,7 @@ var NgwLeaflet = (function () {
18758
18764
  function apiRequest(opt) {
18759
18765
  const params = opt.params;
18760
18766
  return new CancelablePromise((resolve, reject) => {
18761
- opt.connector.connect().then((apiItems) => {
18767
+ return opt.connector.connect().then((apiItems) => {
18762
18768
  let apiItem = apiItems && apiItems[opt.name];
18763
18769
  if (apiItem) {
18764
18770
  apiItem = [...apiItem];