@evergis/api 3.0.121 → 3.0.123

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.
package/dist/api.esm.js CHANGED
@@ -6272,6 +6272,22 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
6272
6272
  return Api;
6273
6273
  }(EventEmitter);
6274
6274
 
6275
+ function generateRandom(min, max) {
6276
+ if (min === void 0) {
6277
+ min = 0;
6278
+ }
6279
+
6280
+ if (max === void 0) {
6281
+ max = 100;
6282
+ }
6283
+
6284
+ let difference = max - min;
6285
+ let rand = Math.random();
6286
+ rand = Math.floor(rand * difference);
6287
+ rand = rand + min;
6288
+ return rand;
6289
+ }
6290
+
6275
6291
  let EvergisTileLayer = /*#__PURE__*/function (_TileLayer) {
6276
6292
  _inherits(EvergisTileLayer, _TileLayer);
6277
6293
 
@@ -6288,6 +6304,7 @@ let EvergisTileLayer = /*#__PURE__*/function (_TileLayer) {
6288
6304
  });
6289
6305
  _this.api = api;
6290
6306
  _this.name = configuration.name;
6307
+ _this.sourceUrl = configuration.sourceUrl;
6291
6308
  _this.subDomains = configuration.subDomains;
6292
6309
  return _this;
6293
6310
  }
@@ -6295,21 +6312,16 @@ let EvergisTileLayer = /*#__PURE__*/function (_TileLayer) {
6295
6312
  _createClass(EvergisTileLayer, [{
6296
6313
  key: "getTileUrl",
6297
6314
  value: function getTileUrl(x, y, level) {
6315
+ var _this$subDomains;
6316
+
6298
6317
  const name = this.name;
6299
- const subDomains = this.subDomains;
6300
- const subDomain = subDomains && subDomains[(x + y + level) % subDomains.length];
6301
- const urlMask = this.api.layers.getTilesLayerImage({
6318
+ const subDomainIndex = this.subDomains ? generateRandom(0, ((_this$subDomains = this.subDomains) == null ? void 0 : _this$subDomains.length) - 1) : undefined;
6319
+ return this.sourceUrl ? (this.subDomains && subDomainIndex !== undefined ? this.sourceUrl.replace("{0}", this.subDomains[subDomainIndex]) : this.sourceUrl).replace("{1}", "" + level).replace("{2}", "" + x).replace("{3}", "" + y) : this.api.layers.getTilesLayerImage({
6302
6320
  x,
6303
6321
  y,
6304
6322
  z: level,
6305
6323
  name
6306
6324
  });
6307
-
6308
- if (subDomain) {
6309
- return "" + addSubDomainToLocation(subDomain) + urlMask;
6310
- }
6311
-
6312
- return urlMask;
6313
6325
  }
6314
6326
  }]);
6315
6327
 
@@ -6714,6 +6726,8 @@ Polyline
6714
6726
  Polygon
6715
6727
 
6716
6728
  Multipoint
6729
+
6730
+ H3Index
6717
6731
  */
6718
6732
 
6719
6733
 
@@ -6731,6 +6745,7 @@ var AttributeType;
6731
6745
  AttributeType["Polyline"] = "Polyline";
6732
6746
  AttributeType["Polygon"] = "Polygon";
6733
6747
  AttributeType["Multipoint"] = "Multipoint";
6748
+ AttributeType["H3Index"] = "H3Index";
6734
6749
  })(AttributeType || (AttributeType = {}));
6735
6750
  /**
6736
6751
  * Describes classification methods.
@@ -6821,6 +6836,8 @@ DataSourceNotFound
6821
6836
 
6822
6837
  DuplicateColumns
6823
6838
 
6839
+ DuplicateAttributes
6840
+
6824
6841
  TableWithoutColumns
6825
6842
 
6826
6843
  InvalidTableReferenceConfiguration
@@ -6852,6 +6869,7 @@ var ConfigurationErrorEnum;
6852
6869
  ConfigurationErrorEnum["InvalidAttributeFormat"] = "InvalidAttributeFormat";
6853
6870
  ConfigurationErrorEnum["DataSourceNotFound"] = "DataSourceNotFound";
6854
6871
  ConfigurationErrorEnum["DuplicateColumns"] = "DuplicateColumns";
6872
+ ConfigurationErrorEnum["DuplicateAttributes"] = "DuplicateAttributes";
6855
6873
  ConfigurationErrorEnum["TableWithoutColumns"] = "TableWithoutColumns";
6856
6874
  ConfigurationErrorEnum["InvalidTableReferenceConfiguration"] = "InvalidTableReferenceConfiguration";
6857
6875
  })(ConfigurationErrorEnum || (ConfigurationErrorEnum = {}));