node.js - Running NPM mapbox-map-image-export -
im new npm/node , trying run seeingly simple command having trouble.
im using vs code , have used terminal clone git repo. 'npm install'.
i trying run command in documentation 'export mapbox_token=your_mapbox_api_public_token'
based on instructions on npm page https://www.npmjs.com/package/mapbox-map-image-export
to type in 'node' command above. 3 dots appear?
in unix systems, export
shell built-in command used mark variable automatic export environment of subsequently executed commands. windows (ms-dos) equivalent command set
.
so, set mapbox token in windows, open command prompt , execute:
set mapbox_token=your_mapbox_api_public_token
you can run mapbox-map-image-export in same command prompt session, this:
export-map mapbox://styles/mapbox/streets-v9 -w=11in -h=8.5in -b=-7.1354,57.9095,-6.1357,58.516 -t=%mapbox_token% -o=lewis.png
note in windows, %name% used variable value, it's %mapbox_token%
(and not $mapbox_token
).
you can specify mapbox token directly in export-map
command, without setting environment variable, e.g.:
export-map mapbox://styles/mapbox/streets-v9 -w=11in -h=8.5in -b=-7.1354,57.9095,-6.1357,58.516 -t=your_mapbox_api_public_token -o=lewis.png
Comments
Post a Comment