isomorphic-mapzen-search
Isomorphic Mapzen search for reuse across our JavaScript libraries. Get an API key here. Coordinates must be anything that can be parsed by lonlng.
Examples
Autocomplete
search({apiKey, text, ...options})
reverse({apiKey, point, format})
API
autocomplete
Search for and address using Mapzen's Autocomplete service.
Parameters
$0
Object$0.apiKey
string The Mapzen API key$0.boundary
Object$0.focusPoint
Object$0.format
boolean$0.layers
string a comma-separated list of layer types$0.sources
string? (optional, default'gn,oa,osm,wof'
)$0.text
string query text$0.url
string? optional URL to override Mapzen autocomplete endpoint (optional, default'https://search.mapzen.com/v1/autocomplete'
)
Returns Promise A Promise that'll get resolved with the autocomplete result
search
Search for an address using Mapzen's Search service.
Parameters
$0
Object$0.apiKey
string The Mapzen API key$0.boundary
Object$0.focusPoint
Object$0.format
boolean$0.size
number? (optional, default10
)$0.sources
string? (optional, default'gn,oa,osm,wof'
)$0.text
string The address text to query for$0.url
string? optional URL to override Mapzen search endpoint (optional, default'https://search.mapzen.com/v1/search'
)
Returns Promise A Promise that'll get resolved with search result
reverse
Reverse geocode using Mapzen's Reverse geocoding service.
Parameters
$0
Object
Returns Promise A Promise that'll get resolved with reverse geocode result