Skip to content

A demo of serving Planetiler or otherwise generated mbtiles to a MapLibre application with Sveltekit

Notifications You must be signed in to change notification settings

FunMiles/Planetiler_MapLibre_Sveltekit

Repository files navigation

MapLibre mbtiles Viewer with SvelteKit

Introduction

This project is a simple viewer for mbtiles files.

Generating the Data File

The quickest way to generate a planet.mbiles file is to use planetiler.

The demo initially centers the map in US/Colorado. You can quickly get workable data with:

wget https://github.com/onthegomap/planetiler/releases/latest/download/planetiler.jar
java -Xmx1g -jar planetiler.jar --download --area=us/colorado

And copy/link data/output.mbtiles to the tile_data directory under the name planet.mbtiles.

Put the planet.mbtiles in the tile_data directory, run npm i or pnpm i and npm run dev or pnpm dev and you should be able to open the map in your browser at the address given by the last command.

Style File

You can modify the map style file in static/mystyle.json

About

A demo of serving Planetiler or otherwise generated mbtiles to a MapLibre application with Sveltekit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published