You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out the release commit equivalent to the version of the Maps SDK that you are using: git checkout {commit hash} (view all release commits)
Compile the binary: make offline
Once the build is complete, you'll see the message Build Succeeded in the terminal. The binary is available under the build folder (for example, on a Mac the file will be in build/macos/Debug/mbgl-offline).
A 2 mile buffer around Sec A is 19MB. This includes contours and terrain but not NAIP.
When I run with --style=https://raw.githubusercontent.com/nst-guide/osm-liberty-topo/gh-pages/style-hybrid-png.json, that gives a 48MB db. So here the NAIP imagery (up to zoom 14) is 30MB for the 2 mile buffer.
Note that --geojson must be a single geometry. If you pass a FeatureCollectino it won't work. In this case, buffer.geojson is a 2-mile buffer around Sec A as a top-level type=Polygon.
It looks like it correctly intersects the polygon with xyz boxes, instead of just taking the bounding box of the provided geometry.
To get the xyz tiles downloaded for a given pack:
sqlite3 offline.db 'SELECT x,y,z from TILES;'
(offline.db is just a Sqlite3 database)
Then if you want to turn those xyz coords into a GeoJSON describing the tiles' geometry:
Use a text editor to convert 1|2|3 to [1, 2, 3] (surely possible with sed but haven't tried)
It looks like sideloading offline packs might get supported in
react-native-mapbox-gl
(https://github.com/react-native-mapbox-gl/maps/pull/588).Building
mbgl-offline
mbgl-offline
is the CLI to assemble offline databases for side-loading.https://github.com/mapbox/mapbox-gl-native/wiki/Sideloading-offline-maps
These worked for me:
Once the build is complete, you'll see the message Build Succeeded in the terminal. The binary is available under the build folder (for example, on a Mac the file will be in build/macos/Debug/mbgl-offline).
Creating the offline pack
To create the offline pack:
A 2 mile buffer around Sec A is 19MB. This includes contours and terrain but not NAIP.
When I run with
--style=https://raw.githubusercontent.com/nst-guide/osm-liberty-topo/gh-pages/style-hybrid-png.json
, that gives a 48MB db. So here the NAIP imagery (up to zoom 14) is 30MB for the 2 mile buffer.Note that
--geojson
must be a single geometry. If you pass a FeatureCollectino it won't work. In this case,buffer.geojson
is a 2-mile buffer around Sec A as a top-leveltype=Polygon
.It looks like it correctly intersects the polygon with xyz boxes, instead of just taking the bounding box of the provided geometry.
To get the xyz tiles downloaded for a given pack:
(
offline.db
is just a Sqlite3 database)Then if you want to turn those xyz coords into a GeoJSON describing the tiles' geometry:
1|2|3
to[1, 2, 3]
(surely possible withsed
but haven't tried)where
db_tiles.txt
hasHere's a visualization of the tiles used for this:
The text was updated successfully, but these errors were encountered: