Coder Social home page Coder Social logo

funmiles / planetiler_maplibre_sveltekit Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 8.28 MB

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

Svelte 36.87% HTML 4.55% TypeScript 44.54% JavaScript 14.03%

planetiler_maplibre_sveltekit's Introduction

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

planetiler_maplibre_sveltekit's People

Contributors

funmiles avatar

Stargazers

 avatar oxomoto avatar Zvika Rap avatar

Watchers

Joaquín Sánchez avatar  avatar

planetiler_maplibre_sveltekit's Issues

Deploy to Android with capacitor

Hi @FunMiles

Have you ever tried to run your project on Android?
I'm currently looking at a solution using capacitor, and I can serve a static page but it looks like the mbtiles is not copied over during the build hence the server can't access the tiles.

I'd be really grateful if you could have a look, and I'd appreciate any feedback!

I like the concept currently used versus tileserver but I'd need to make sure it's viable on platform such as Android or IOS. Sveltekit and capacitor makes it (normally) super easy :)

Serve local sprites and glyphs

hi @FunMiles
if you replace your glyphs input with "glyphs": "glyphs/{fontstack}/{range}.pbf", and store your local glyphs under static then you can serve local glyphs.

I'm trying to do something similar for the sprite, but unsuccessful at the moment
"sprite": "@origin@/sprites/sprite",
with a folder sprites under routes that contain a sprite.json (+png)

Any idea ?
FYI you can create your own sprite using https://github.com/mapbox/spritezero

dependencies update

Hi Michel,
I've tried to install and run your application but it seems there's an issue with some dependencies. Anyway you could have a look ?
Regards,
Ben

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.