state-polygon
v1.0.3
Published
US and canada state polygon - state outline
Downloads
603
Maintainers
Readme
statepolygon
##Only US and canada states are supported.
Methods: 1). stateNamesToAbbreviations - converts state names to abbreviations. 2). statePolygonFromAbb - gets state outline polygon from state abbreviations. 3). statePolygonFromNames - gets state outline polygon from state names.
Note: Input to all these methods can be string or array of string
##Sample Usage
import { statePolygonFromAbb } from 'statepolygon'
const stateAbb = statepolygon.fromStateAbbreviations(['California', 'new york']);
console.log('reqStatePoly :: ', reqStatePoly); // ['CA', 'NY']
import { statePolygonFromNames } from 'statepolygon'
const reqStatePoly = statePolygonFromNames(['California', 'new york']);
console.log('reqStatePoly :: ', reqStatePoly);
import { statePolygonFromAbb } from 'statepolygon'
const reqStatePoly = statePolygonFromAbb(['California', 'new york']);
console.log('reqStatePoly :: ', reqStatePoly);
import { allPolygon } from 'statepolygon'
const allStatesPolygon = allPolygon();
console.log('reqStatePoly :: ', allStatesPolygon); // Array of all states poygon