Reputation: 2053
Mapbox data management workflow documentation (or my unserstanding of it) seems to be lacking.
I currently have a custom style
with some custom tilesets
added to it. Whenever the data of my tileset
needs to be updated, is there and elegant way to update the existing data through the API and retain any styling for a particular style
?
My best guess for what that workflow would look like:
tileset
tileset
IDstyle
's current tileset
IDstileset
from style
tileset
to style
tileset
to match old tileset
I'm hoping I'm missing something obvious that lets me do the following instead:
style
's tileset
's dataUpvotes: 1
Views: 1220
Reputation: 126105
You can use Mapbox's mapbox-upload
Node module to replace an existing tileset: https://github.com/mapbox/mapbox-upload
var progress = upload({
file: __dirname + '/test.mbtiles', // Path to mbtiles file on disk.
account: 'test', // Mapbox user account.
accesstoken: 'validtoken', // A valid Mapbox API secret token with the uploads:write scope enabled.
mapid: 'test.upload', // The identifier of the map to create or update.
name: 'My upload' // Optional name to set, otherwise a default such as original.geojson will be used.
});
Set the mapid
property to the id of your existing tileset. Real-life example here.
Similarly via the command line:
$ npm install --global mapbox-upload
$ export MapboxAccessToken=<access token with uploads:write scope enabled>
$ mapbox-upload username.dataid /path/to/file
Upvotes: 2