Coder Social home page Coder Social logo

mapbbox.js's Introduction

mapbbox.js

This node script generates (and optionally downloads) maps through MapBox's static maps API.

Installation

  1. Clone this repository
  2. cd mapbbox
  3. npm install
  4. Copy/paste your MapBox access token into the file mapbox_token

To view your default secret access token, create new tokens, or revoke tokens, visit your MapBox account settings page.

Usage

$ ./mapbbox.js --help 

  Usage: mapbbox [options]

  Options:

    -h, --help                        output usage information
    -V, --version                     output the version number
    -b, --bbox <lon1,lat1,lon2,lat2>  [required] bounding box
    -h, --height <n>                  [required] image height in px
    -w, --width <n>                   [required] image width in px
    -o, --output [path]               [optional] output png with optional path
    -q, --quiet                       [optional] do not print output path (only works with -o/--output)

Example

$ ./mapbbox.js -h 480 -w 640 -b -74.259094,40.477398,-73.700165,40.91758

https://api.mapbox.com/v4/mapbox.emerald/-73.9796295,40.697489000000004,10/640x480.png?access_token=<my access token>

$ ./mapbbox.js -h 480 -w 640 -b -74.259094,40.477398,-73.700165,40.91758 -o NYC.png
NYC.png

$ open NYC.png

alt NYC image output

To do something with the image immediately, without having to run a separate command (such as the open command above), pipe the output to xargs:

$ ./mapbbox.js -h 480 -w 640 -b -74.259094,40.477398,-73.700165,40.91758 -o NYC.png | xargs open

mapbbox.js's People

Contributors

mfurlend avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.