Parse geocoder data into easily usable form
Gecoder returns data in standard Google JSON output. parse-geocoder makes the results easier to manipulate.
npm install --save parse-geocoder
var result = parseGeocoder.parseResult(geocoderData.results[0]);
Returns a parsed result object containing:
- addressComponent: hash of address component types
{ country: {longName: 'Ghana', shortName: 'GH'}, administrative_area_level_1: {longName: 'Greater Accra', shortName: 'Greater Accra'} }
- formattedAddress: unmodified formatted_address of result
- geometry: unmodified geometry data of result
- addressPrecision: level to which location is accurate
See parseResult.json for sample.
var result = parseGeocoder.parse(geocoderData);
Returns an array of parseResults.
See parse.json for sample.
MIT