Skip to content

Offline maps stored in IndexedDB and 2GB blob limit in Chrome #99

@patrykkalinowski

Description

@patrykkalinowski

I'm building a PWA app where I want to store PMTiles inside IndexedDB for offline use. Unfortunately, Chrome has 2GB limit per blob/Arraybuffer which prevents any large map from being loaded to memory.
One popular workaround to this is to divide files into chunks, each one less than 2GB (100MB by default if I recall).

My idea is to only serve part of PMTiles file requested by library based on byte range: merge corresponding chunks (each chunk holds its byte range in original file) and return one properly sliced blob as URL to query. I assume byte ranges would have to be modified (translated) to this smaller blob (for example, instead of starting from X-nth byte of big file, start from 1st byte of small file).

I'm stuck on translating byte ranges to new file. Anyone has tips how to approach this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions