Skip to content

scott113341/caltopo-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
  }
]
*/

About

Get the underlying JSON from a CalTopo map.

Resources

License

Stars

Watchers

Forks

Packages

No packages published