gis-common 5.1.26 → 5.1.28

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.
@@ -951,7 +951,7 @@ myArray.prototype.min = function(f = (d) => d) {
951
951
  return this.asc(f)[0];
952
952
  };
953
953
  myArray.prototype.sum = function(f = (d) => d) {
954
- return this.length === 1 ? f(this[0]) : this.length > 1 ? this.reduce((prev = 0, curr = 0) => f(prev) + f(curr)) : 0;
954
+ return this.length === 1 ? f(this[0]) : this.length > 1 ? this.reduce((prev = 0, curr = 0) => prev + f(curr), 0) : 0;
955
955
  };
956
956
  myArray.prototype.avg = function(f = (d) => d) {
957
957
  return this.length ? this.sum(f) / this.length : 0;
@@ -1925,7 +1925,7 @@ const GeoJsonUtil = {
1925
1925
  getFeatureBbox(feature) {
1926
1926
  const geometry = feature.geometry;
1927
1927
  if (!geometry || !geometry.coordinates) {
1928
- return null;
1928
+ return void 0;
1929
1929
  }
1930
1930
  const coords = geometry.coordinates;
1931
1931
  let minX = Infinity;
@@ -1954,9 +1954,9 @@ const GeoJsonUtil = {
1954
1954
  processCoordinates(coords);
1955
1955
  if (!hasCoordinates || minX === Infinity) {
1956
1956
  feature.bbox = void 0;
1957
- return null;
1957
+ } else {
1958
+ feature.bbox = [minX, minY, maxX, maxY];
1958
1959
  }
1959
- feature.bbox = [minX, minY, maxX, maxY];
1960
1960
  return feature.bbox;
1961
1961
  },
1962
1962
  getFeatureCollectionBbox(featureCollection, recalculate = false) {
@@ -1964,12 +1964,12 @@ const GeoJsonUtil = {
1964
1964
  throw new Error("无效的GeoJSON FeatureCollection数据");
1965
1965
  }
1966
1966
  if (featureCollection.bbox && !recalculate) {
1967
- return featureCollection;
1967
+ return featureCollection.bbox;
1968
1968
  }
1969
1969
  const features = featureCollection.features;
1970
1970
  if (features.length === 0) {
1971
1971
  featureCollection.bbox = void 0;
1972
- return featureCollection;
1972
+ return featureCollection.bbox;
1973
1973
  }
1974
1974
  let minX = Infinity;
1975
1975
  let minY = Infinity;
@@ -18129,6 +18129,7 @@ const _Storage = class _Storage {
18129
18129
  } else if (typeof value === "object" && typeof value.data !== "undefined") {
18130
18130
  const expires = value.expires;
18131
18131
  if (expires && Date.now() > expires) {
18132
+ localStorage.removeItem(query_key);
18132
18133
  return missing;
18133
18134
  }
18134
18135
  return value.data;
@@ -18158,6 +18159,7 @@ const _Storage = class _Storage {
18158
18159
  } else if (typeof value === "object" && typeof value.data !== "undefined") {
18159
18160
  const expires = value.expires;
18160
18161
  if (expires && Date.now() > expires) {
18162
+ sessionStorage.removeItem(query_key);
18161
18163
  return missing;
18162
18164
  }
18163
18165
  return value.data;