Database of locations for ebird
npm install --save bird-locations
var locations = require('bird-locations');
locations.getByCode('US').then((data) => {
// Metadata for a bird
console.log(data);
/*
{
countryCode: 'US',
localAbbrev: 'US',
name: 'United States',
nameLong: 'United States of America',
nameShort: '',
}
*/
}).catch((error) => {
console.log(error);
})
Return all locations
locations.getAll()
Return data for a location
locations.getByCode(code)
Take the result from getByCode
and returns a string
locations.getNiceName(result)
A wrapper to react-select
type-a-head for ebird locations.
var LocationsSearch = require('bird-locations/lib/search');
/**
Location {
code: ebird code for location
label: Nice name of location
}
*/
<LocationsSearch value={this.state.location} onChange={this.updateLocation} />