-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load .mbtiles #54
Comments
Here is my code for reading a pbf tile from a mbtiles file (ugly Python code, without using -y property) def _get(z, x, y):
db = get_db()
if db is None:
return None
c = db.cursor()
y2 = (1 << int(z)) - 1 - int(y)
c.execute(
"select tile_data from tiles where zoom_level = %s and tile_column = %s and tile_row = %s" %
(str(z), str(x), str(y2)))
row = c.fetchone()
if not row:
return None
content = BytesIO(row[0])
g = gzip.GzipFile(fileobj=content)
return g.read() |
It would be interesting to try on some of the https://openmaptiles.org/downloads/#city extracts, as they are small enough for a browser to load. This is a certain possibility. Things to check:
With those answered, it should be really simple to implement a |
Hey guys, is there any info about this issue? I'm looking for a sample code for using offline vector data in leaflet (mbtiles or pbf). |
this._stmt.getAsObject(coords) = {tile_data: Uint8Array} I've playing with this merging, and as of today I have Leaflet.TileLayer.MBTiles providing pbf data as blob, but I can't find any way to easily feed the VectorGrid, as it looks for actual files to read. But... I'm on it |
How Leaflet.TileLayer.MBTiles could be merged in a Leaflet.VectorGrid.MBTiles?
Should it be a new project?
Any opinion @IvanSanchez ?
The text was updated successfully, but these errors were encountered: