2.0.0 • Published 7 years ago

caltopo-json v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

caltopo-json

npm-version build-status dependencies dev-dependencies

Get the underlying JSON from a CalTopo map.

npm install caltopo-json

usage example

Get the JSON for CalTopo map https://caltopo.com/m/F56K

// ES6
import getJson from 'caltopo-json';

getJson('F56K').then(json => console.log(json.Marker));
  
/*
[
  {
    "comments": "commentz",
    "id": 0,
    "label": "Test Point",
    "position": {
      "id": 23773245,
      "lat": 39.46486419970058,
      "lng": -106.64050943389896
    },
    "updated": "1479945025000",
    "url": "#FF0000"
  }
]
*/
// ES5
const getJson = require('caltopo-json').default;

getJson('F56K').then(json => console.log(json.Marker));
  
/*
[
  {
    "comments": "commentz",
    "id": 0,
    "label": "Test Point",
    "position": {
      "id": 23773245,
      "lat": 39.46486419970058,
      "lng": -106.64050943389896
    },
    "updated": "1479945025000",
    "url": "#FF0000"
  }
]
*/
2.0.0

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago