mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(pwa): cache Amap tiles like the other raster presets
Without a Workbox rule for is.autonavi.com the offline pre-download fetched the tiles and stored none of them, the hole #2180 closed for the OpenStreetMap DE and Stadia presets.
This commit is contained in:
@@ -126,6 +126,18 @@ export default defineConfig(({ mode }) => ({
|
||||
cacheableResponse: { statuses: [0, 200] },
|
||||
},
|
||||
},
|
||||
{
|
||||
// Amap road and satellite presets, served from the shard hosts under
|
||||
// is.autonavi.com (src/constants/mapDefaults.ts). Without a rule here
|
||||
// they would be the #2180 hole all over again.
|
||||
urlPattern: /^https:\/\/(?:[a-z0-9]+\.)?is\.autonavi\.com\/.*/i,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'map-tiles',
|
||||
expiration: { maxEntries: 12288, maxAgeSeconds: 30 * 24 * 60 * 60 },
|
||||
cacheableResponse: { statuses: [0, 200] },
|
||||
},
|
||||
},
|
||||
{
|
||||
// The GL style DOCUMENT, for both providers. It has to be matched
|
||||
// before the tile rules below, because Workbox takes the first route
|
||||
|
||||
Reference in New Issue
Block a user