- Node.js
- Browser
Import and configure the canvas adapter
In Node.js, the library uses CanvasKit (WebAssembly) for tile rendering. You must tell it where the
.wasm file lives before opening any GeoPackage.Open a GeoPackage file
Pass the path to a Or using
.gpkg file. GeoPackageManager.open returns a Promise.async/await:Query features as GeoJSON
Iterate over every feature in a table as a GeoJSON
Feature object. Always call close() on the result set when you are done.Get a tile
Retrieve a web-mercator tile at a given x/y/zoom coordinate and convert it to a base-64 PNG string.
Memory management (Node.js)
CanvasKit allocates off-heap WebAssembly memory for every image and canvas it creates. The JavaScript garbage collector cannot free this memory automatically, so you must dispose of these objects manually.Next steps
Installation
Full setup instructions for Node.js, browser, and Web Workers.
Feature queries
Spatial bounding-box queries, pagination, and attribute filtering.
Tile rendering
Render map tiles, draw feature tiles, and export images.
Web Worker
Run GeoPackage operations off the main thread.