-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
map.preloadOnly does not work (exception fired) #12696
Comments
Can you please provide a minimal live example reproducing the error, as prompted in the issue template? |
issue details updated |
I can confirm this issue. It appears when you try preloading tiles right after adding a source until it's loaded. Started the fix here #12699. @fvisticot In the meantime, you can wait until the source is loaded before preloading tiles map.on("load", async () => {
map.addSource("mapbox-dem", {
type: "raster-dem",
url: "mapbox://mapbox.terrain-rgb",
tileSize: 512,
maxzoom: 14,
});
map.setTerrain({source: "mapbox-dem", exaggeration: 1.5});
await map.once('idle');
map.flyTo({
center: [-3.45344, 48.70047],
zoom: 14.5,
bearing: 130,
pitch: 75,
duration: 6500,
essential: true,
preloadOnly: true
});
}); |
mapbox-gl-js version: 2.14.1
browser: chrome
Steps to Trigger Behavior
map.flyTo({ ...end, duration: 6500, essential: true, preloadOnly: true })
Actual Behavior
urce_cache.js:1025 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'tileZoom') at source_cache.js:1025:108 at util.js:277:9 at Array.forEach (<anonymous>) at M (util.js:276:11) at sy._preloadTiles (source_cache.js:1024:9) at map.js:3596:52 at util.js:277:9 at Array.forEach (<anonymous>) at Object.M [as asyncAll] (util.js:276:11) at Map._preloadTiles (map.js:3596:9) (
Source code:
index.html:
The text was updated successfully, but these errors were encountered: