@mapwhit/tilerenderer 1.1.0 → 1.1.1
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/build/min/package.json +1 -1
- package/package.json +1 -1
- package/src/source/source_cache.js +9 -2
- package/src/style/style.js +7 -2
- package/src/ui/map.js +1 -1
package/build/min/package.json
CHANGED
package/package.json
CHANGED
|
@@ -75,10 +75,14 @@ class SourceCache extends Evented {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Return true if no tile data is pending, tiles will not change unless
|
|
78
|
+
* Return `true` if no tile data is pending, tiles will not change unless
|
|
79
79
|
* an additional API call is received.
|
|
80
|
+
* If `ignoreTilesLoading` is set, return `true` even when tiles are pending,
|
|
81
|
+
* otherwise there is no way to check that source is ready after loading style.
|
|
82
|
+
* Without `ignoreTilesLoading` the state of style being loaded or not depends on
|
|
83
|
+
* the tiles being in the process of loading or not.
|
|
80
84
|
*/
|
|
81
|
-
loaded() {
|
|
85
|
+
loaded(ignoreTilesLoading) {
|
|
82
86
|
if (this.#sourceErrored) {
|
|
83
87
|
return true;
|
|
84
88
|
}
|
|
@@ -87,6 +91,9 @@ class SourceCache extends Evented {
|
|
|
87
91
|
return false;
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
if (ignoreTilesLoading) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
90
97
|
for (const tile of this._tiles.values()) {
|
|
91
98
|
if (tile.state !== 'loaded' && tile.state !== 'errored') {
|
|
92
99
|
return false;
|
package/src/style/style.js
CHANGED
|
@@ -244,7 +244,12 @@ class Style extends Evented {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Returns `true` when style is loaded.
|
|
249
|
+
* @param {Boolean} ignoreTilesLoading set to `true` to check that style is loaded
|
|
250
|
+
* even when sources are loading tiles
|
|
251
|
+
*/
|
|
252
|
+
loaded(ignoreTilesLoading) {
|
|
248
253
|
if (!this._loaded) {
|
|
249
254
|
return false;
|
|
250
255
|
}
|
|
@@ -254,7 +259,7 @@ class Style extends Evented {
|
|
|
254
259
|
}
|
|
255
260
|
|
|
256
261
|
for (const id in this._sources) {
|
|
257
|
-
if (!this._sources[id].loaded()) {
|
|
262
|
+
if (!this._sources[id].loaded(ignoreTilesLoading)) {
|
|
258
263
|
return false;
|
|
259
264
|
}
|
|
260
265
|
}
|