azure-maps-control 3.3.0 → 3.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.
@@ -52217,7 +52217,7 @@ uniform ${precision} ${type} u_${name};
52217
52217
  return UserAgent;
52218
52218
  }());
52219
52219
 
52220
- var version = "3.3.0";
52220
+ var version = "3.4.0";
52221
52221
 
52222
52222
  /**
52223
52223
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -52939,6 +52939,21 @@ uniform ${precision} ${type} u_${name};
52939
52939
  function clearPrewarmedResources() {
52940
52940
  maplibregl.clearPrewarmedResources();
52941
52941
  }
52942
+ /**
52943
+ * Adds a custom load resource function that will be called when using a URL that starts with a custom url schema.
52944
+ * @param customProtocol - the protocol to hook, for example 'custom'
52945
+ * @param loadFn - the function to use when trying to fetch a tile specified by the customProtocol
52946
+ */
52947
+ function addProtocol(customProtocol, loadFn) {
52948
+ maplibregl.addProtocol(customProtocol, loadFn);
52949
+ }
52950
+ /**
52951
+ * Removes a previously added protocol in the main thread.
52952
+ * @param customProtocol - the custom protocol to remove registration for
52953
+ */
52954
+ function removeProtocol(customProtocol) {
52955
+ maplibregl.removeProtocol(customProtocol);
52956
+ }
52942
52957
  /**
52943
52958
  * Returns if authentication options are set.
52944
52959
  * @internal
@@ -74194,7 +74209,7 @@ uniform ${precision} ${type} u_${name};
74194
74209
  /**
74195
74210
  * The callback used when styleOptions.autoResize is true.
74196
74211
  */
74197
- _this._windowResizeCallback = function () { return _this.resize(); };
74212
+ _this._resizeCallback = function () { return _this.resize(); };
74198
74213
  // Update global defaults based on which options were specified to this constructor.
74199
74214
  _this._updateGlobalDefaults(options);
74200
74215
  _this.serviceOptions = new ServiceOptions().merge(options);
@@ -74477,8 +74492,9 @@ uniform ${precision} ${type} u_${name};
74477
74492
  if ('maxPitch' in options) {
74478
74493
  this.map.setMaxPitch(options.maxPitch);
74479
74494
  }
74480
- this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
74481
- this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
74495
+ if ('minZoom' in options) {
74496
+ this.map.setMinZoom(options.minZoom);
74497
+ }
74482
74498
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
74483
74499
  }
74484
74500
  else {
@@ -75178,13 +75194,14 @@ uniform ${precision} ${type} u_${name};
75178
75194
  * Clean up the map's resources. Map will not function correctly after calling this method.
75179
75195
  */
75180
75196
  Map.prototype.dispose = function () {
75181
- var _a;
75197
+ var _a, _b;
75182
75198
  this.clear();
75183
75199
  this.map.remove();
75184
75200
  (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
75185
75201
  this.removed = true;
75186
75202
  // Remove event listeners
75187
- window.removeEventListener("resize", this._windowResizeCallback);
75203
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
75204
+ this.resizeObserver = null;
75188
75205
  while (this.getMapContainer().firstChild) {
75189
75206
  var currChild = this.getMapContainer().firstChild;
75190
75207
  this.getMapContainer().removeChild(currChild);
@@ -75413,10 +75430,15 @@ uniform ${precision} ${type} u_${name};
75413
75430
  */
75414
75431
  Map.prototype._setAutoResize = function (autoResize) {
75415
75432
  if (autoResize) {
75416
- window.addEventListener("resize", this._windowResizeCallback);
75433
+ if (!this.resizeObserver) {
75434
+ this.resizeObserver = new ResizeObserver(this._resizeCallback);
75435
+ }
75436
+ this.resizeObserver.observe(this.map.getContainer());
75417
75437
  }
75418
75438
  else {
75419
- window.removeEventListener("resize", this._windowResizeCallback);
75439
+ if (this.resizeObserver) {
75440
+ this.resizeObserver.unobserve(this.map.getContainer());
75441
+ }
75420
75442
  }
75421
75443
  };
75422
75444
  /**
@@ -76141,6 +76163,7 @@ uniform ${precision} ${type} u_${name};
76141
76163
  exports._hasSetView = _hasSetView;
76142
76164
  exports._hasWorkerCount = _hasWorkerCount;
76143
76165
  exports.addImageTemplate = addImageTemplate;
76166
+ exports.addProtocol = addProtocol;
76144
76167
  exports.clearPrewarmedResources = clearPrewarmedResources;
76145
76168
  exports.control = index$2;
76146
76169
  exports.data = index$4;
@@ -76165,6 +76188,7 @@ uniform ${precision} ${type} u_${name};
76165
76188
  exports.layer = index;
76166
76189
  exports.math = index$3;
76167
76190
  exports.prewarm = prewarm;
76191
+ exports.removeProtocol = removeProtocol;
76168
76192
  exports.setAuthenticationOptions = setAuthenticationOptions;
76169
76193
  exports.setDomain = setDomain;
76170
76194
  exports.setLanguage = setLanguage;
@@ -52217,7 +52217,7 @@ uniform ${precision} ${type} u_${name};
52217
52217
  return UserAgent;
52218
52218
  }());
52219
52219
 
52220
- var version$2 = "3.3.0";
52220
+ var version$2 = "3.4.0";
52221
52221
 
52222
52222
  /**
52223
52223
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -52939,6 +52939,21 @@ uniform ${precision} ${type} u_${name};
52939
52939
  function clearPrewarmedResources() {
52940
52940
  maplibregl.clearPrewarmedResources();
52941
52941
  }
52942
+ /**
52943
+ * Adds a custom load resource function that will be called when using a URL that starts with a custom url schema.
52944
+ * @param customProtocol - the protocol to hook, for example 'custom'
52945
+ * @param loadFn - the function to use when trying to fetch a tile specified by the customProtocol
52946
+ */
52947
+ function addProtocol(customProtocol, loadFn) {
52948
+ maplibregl.addProtocol(customProtocol, loadFn);
52949
+ }
52950
+ /**
52951
+ * Removes a previously added protocol in the main thread.
52952
+ * @param customProtocol - the custom protocol to remove registration for
52953
+ */
52954
+ function removeProtocol(customProtocol) {
52955
+ maplibregl.removeProtocol(customProtocol);
52956
+ }
52942
52957
  /**
52943
52958
  * Returns if authentication options are set.
52944
52959
  * @internal
@@ -74638,7 +74653,7 @@ uniform ${precision} ${type} u_${name};
74638
74653
  this.loadAttributionOnceSourcesLoaded = function () {
74639
74654
  var sources = _this.getMapStyleVisibleSources();
74640
74655
  Promise.all(sources.map(function (source) { return new Promise(function (resolve, reject) {
74641
- if ('tiles' in source) {
74656
+ if ('tiles' in source || (source === null || source === void 0 ? void 0 : source.type) === 'geojson') {
74642
74657
  resolve(source);
74643
74658
  // TileJSON source may yet be unresolved
74644
74659
  }
@@ -97855,7 +97870,7 @@ uniform ${precision} ${type} u_${name};
97855
97870
  /**
97856
97871
  * The callback used when styleOptions.autoResize is true.
97857
97872
  */
97858
- _this._windowResizeCallback = function () { return _this.resize(); };
97873
+ _this._resizeCallback = function () { return _this.resize(); };
97859
97874
  // Update global defaults based on which options were specified to this constructor.
97860
97875
  _this._updateGlobalDefaults(options);
97861
97876
  _this.serviceOptions = new ServiceOptions().merge(options);
@@ -98144,8 +98159,9 @@ uniform ${precision} ${type} u_${name};
98144
98159
  if ('maxPitch' in options) {
98145
98160
  this.map.setMaxPitch(options.maxPitch);
98146
98161
  }
98147
- this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
98148
- this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
98162
+ if ('minZoom' in options) {
98163
+ this.map.setMinZoom(options.minZoom);
98164
+ }
98149
98165
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
98150
98166
  }
98151
98167
  else {
@@ -98845,13 +98861,14 @@ uniform ${precision} ${type} u_${name};
98845
98861
  * Clean up the map's resources. Map will not function correctly after calling this method.
98846
98862
  */
98847
98863
  Map.prototype.dispose = function () {
98848
- var _a;
98864
+ var _a, _b;
98849
98865
  this.clear();
98850
98866
  this.map.remove();
98851
98867
  (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
98852
98868
  this.removed = true;
98853
98869
  // Remove event listeners
98854
- window.removeEventListener("resize", this._windowResizeCallback);
98870
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
98871
+ this.resizeObserver = null;
98855
98872
  while (this.getMapContainer().firstChild) {
98856
98873
  var currChild = this.getMapContainer().firstChild;
98857
98874
  this.getMapContainer().removeChild(currChild);
@@ -99080,10 +99097,15 @@ uniform ${precision} ${type} u_${name};
99080
99097
  */
99081
99098
  Map.prototype._setAutoResize = function (autoResize) {
99082
99099
  if (autoResize) {
99083
- window.addEventListener("resize", this._windowResizeCallback);
99100
+ if (!this.resizeObserver) {
99101
+ this.resizeObserver = new ResizeObserver(this._resizeCallback);
99102
+ }
99103
+ this.resizeObserver.observe(this.map.getContainer());
99084
99104
  }
99085
99105
  else {
99086
- window.removeEventListener("resize", this._windowResizeCallback);
99106
+ if (this.resizeObserver) {
99107
+ this.resizeObserver.unobserve(this.map.getContainer());
99108
+ }
99087
99109
  }
99088
99110
  };
99089
99111
  /**
@@ -99813,6 +99835,7 @@ uniform ${precision} ${type} u_${name};
99813
99835
  exports._hasSetView = _hasSetView;
99814
99836
  exports._hasWorkerCount = _hasWorkerCount;
99815
99837
  exports.addImageTemplate = addImageTemplate;
99838
+ exports.addProtocol = addProtocol;
99816
99839
  exports.clearPrewarmedResources = clearPrewarmedResources;
99817
99840
  exports.control = index$2;
99818
99841
  exports.data = index$4;
@@ -99837,6 +99860,7 @@ uniform ${precision} ${type} u_${name};
99837
99860
  exports.layer = index;
99838
99861
  exports.math = index$3;
99839
99862
  exports.prewarm = prewarm;
99863
+ exports.removeProtocol = removeProtocol;
99840
99864
  exports.setAuthenticationOptions = setAuthenticationOptions;
99841
99865
  exports.setDomain = setDomain;
99842
99866
  exports.setLanguage = setLanguage;