Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rendering vector tiles generated from OSM data by OpenMapTiles

NotificationsYou must be signed in to change notification settings

TomasHubelbauer/osm-vector-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEMO

In this repository I prototype a vector map tile rendered. I am using an extractfrom the OSM maps provided by OpenMapTiles. I am using the freely availablesnapshot of Prague from 2017-07-03.

https://openmaptiles.com/downloads/dataset/osm/europe/czech-republic/prague

MBTILES file format is a SQLite database with a specific schema, documented here:

https://github.com/mapbox/mbtiles-spec

I am working on a JavaScript SQLite database library found here:

https://github.com/TomasHubelbauer/sqlite-javascript

Unfortunately it is not possible to use WebSQL to access the database, becauseit is barely supported (works in Chrome and Safari though) and is not able towork off a given file.

The vector tiles are stored in the ProtoBuf format in the database table calledimages. This is true of the particular database included in this repository,but the MBTILES format also supports raster tiles. To check what sort of tilesyour MBTILES database contains, check themetadata table, theformat columnin particular.

The vector tile database file is loaded upon user gesture and with loadingindicator, because it is really big (70 MB).

I am toying around with an idea of using a service worker to cache the file whenthe user clicks the download button and the application determining whether itwas already downloaded or not by inspecting thecaches object or issuing arequest with some marker (header/fragment/query) which would tell the worker toactually download if present or fail to indicate not having been cached yet ifnot present.

The worker might break the download indication (worried it will split thepipeline into two steps - worker downloads and then the page downloads from thecache) so if that's the case, we can try ranged fetch to preserve the ability todownload with indication as GitHub Pages support ranged requests.

To-Do

Implement custom protobuf wire format parser

Because the MapBox one sucks and there don't seem to be others not requiring the schema

Check out Qwant maps, they have a public vector tile server

Check out the Mapy.cz vector tile server (might be just labels?)

About

Rendering vector tiles generated from OSM data by OpenMapTiles

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp