new PMTilesSliceSource(url, optionsopt)
A pmtiles `Source` that reads the archive via **200-slice** (`?r=start-end`)
so responses are browser-HTTP-cacheable 200s (not 206 partials).
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | the archive URL (no `pmtiles://` prefix), e.g. `https://host/default`. | ||||||||||||||||
options |
Object |
<optional> |
Properties
|
- Since:
- 2.0.0
- Source:
Members
(static) defaultGate
Shared default gate for slice sources — timeout+retry ON, concurrency cap OFF
(the tile origin is fast, so uncapped is smoother; the cap is an opt-in
tradeoff). `bemap.MapLibreMap` tunes it from `opts.tilesSlice*`. Honors a
`?nogate` URL kill-switch.
- Since:
- 2.0.0
- Source:
Methods
getBytes(offset, length, signalopt, etagopt) → {Promise.<{data:ArrayBuffer, etag: (String|undefined), cacheControl: (String|undefined), expires: (String|undefined)}>}
Read `[offset, offset+length)` as a 200-slice. Builds `?r=-`
(inclusive), sends NO `Range` header, validates the response is 2xx with the
exact byte length, and returns the pmtiles `RangeResponse` shape.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
offset |
Number | ||
length |
Number | ||
signal |
AbortSignal |
<optional> |
pmtiles cancellation signal |
etag |
String |
<optional> |
the archive's expected ETag (from the pmtiles header); two STRONG, DIFFERENT etags throw `pmtiles.EtagMismatch` so the reader invalidates + re-reads fresh (EVMOVE-457). Weak/missing ⇒ no comparison. |
Returns:
- Type
- Promise.<{data:ArrayBuffer, etag: (String|undefined), cacheControl: (String|undefined), expires: (String|undefined)}>
getKey()
pmtiles cache key — the archive URL, matching the Protocol's stripped `pmtiles://` key. @public