@spurreiter/geocoder
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "@spurreiter/geocoder", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Node geocoding library, google maps, bing maps, mapquest, mapbox, here maps, arcgis, nominatim, ...", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -34,5 +34,6 @@ # geocoder | ||
| [OpendataFranceGeocoder](https://geo.api.gouv.fr/adresse) | ✅ | ✅ | ❌ | France only | | ||
| [OpenMapQuest](https://developer.mapquest.com/documentation/open/nominatim-search/) | ✅ | ✅ | ❌ | Search Results based on OSM | | ||
| [OsmGeocoder](https://nominatim.org/release-docs/develop/) | ✅ | ✅ | ❌ | Searches nominatim.org | | ||
| [PeliasGeocoder](https://github.com/pelias/documentation/blob/master/README.md) | ✅ | ✅ | ❌ | Local or [Geocode.earth](https://geocode.earth/docs) | | ||
| [PickpointGeocoder](https://pickpoint.io/api-reference) | ✅ | ✅ | ❌ | | | ||
| [PickpointGeocoder](https://pickpoint.io/api-reference) | ✅ | ✅ | ❌ | Search Results based on OSM | | ||
| [TeleportGeocoder](https://developers.teleport.org/api/resources/) | ✅ | ✅ | ❌ | Searches only by city names, no addresses | | ||
@@ -115,3 +116,3 @@ | [YandexGeocoder](https://yandex.com/dev/maps/geocoder/) | ✅ | ✅ | ❌ | | | ||
const geocoders = [ | ||
new HereGeocoder(adapter, { apiKey_ 'your-api-key', language }), | ||
new HereGeocoder(adapter, { apiKey: 'your-api-key', language }), | ||
new OsmGeocoder(adapter, { language }) | ||
@@ -136,3 +137,3 @@ ] | ||
const geocoders = [ | ||
new HereGeocoder(adapter, { apiKey_ 'your-api-key' }), | ||
new HereGeocoder(adapter, { apiKey: 'your-api-key' }), | ||
new OsmGeocoder(adapter) | ||
@@ -139,0 +140,0 @@ ] |
@@ -14,2 +14,3 @@ export * from './abstract.js' | ||
export * from './opendatafrance.js' | ||
export * from './openmapquest.js' | ||
export * from './osm.js' | ||
@@ -16,0 +17,0 @@ export * from './pelias.js' |
@@ -69,2 +69,4 @@ import { AbstractGeocoder } from './abstract.js' | ||
* @param {number} [options.dedupe] | ||
* @param {string} [options.endpoint] custom endpoint | ||
* @param {string} [options.revEndpoint] custom reverse endpoint | ||
*/ | ||
@@ -74,4 +76,14 @@ constructor (adapter, options = {}) { | ||
const { | ||
endpoint = 'https://nominatim.openstreetmap.org/search', | ||
revEndpoint = 'https://nominatim.openstreetmap.org/reverse', | ||
apiKey, | ||
...params | ||
} = options | ||
this.endpoint = endpoint | ||
this.revEndpoint = revEndpoint | ||
this.params = { | ||
...options, | ||
...params, | ||
format: 'json', // force these params | ||
@@ -82,10 +94,2 @@ addressdetails: 1 | ||
get endpoint () { | ||
return 'https://nominatim.openstreetmap.org/search' | ||
} | ||
get revEndpoint () { | ||
return 'https://nominatim.openstreetmap.org/reverse' | ||
} | ||
/** | ||
@@ -92,0 +96,0 @@ * @param {string|OsmForwardQuery} query |
@@ -33,2 +33,3 @@ import { OsmGeocoder } from './osm.js' | ||
* @param {object} options | ||
* @param {string} options.apiKey | ||
* @param {number} [options.limit=10] | ||
@@ -46,2 +47,5 @@ * @param {string} [options.language] | ||
this.endpoint = 'https://api.pickpoint.io/v1/forward' | ||
this.revEndpoint = 'https://api.pickpoint.io/v1/reverse' | ||
this.params = { | ||
@@ -54,10 +58,2 @@ ...params, | ||
} | ||
get endpoint () { | ||
return 'https://api.pickpoint.io/v1/forward' | ||
} | ||
get revEndpoint () { | ||
return 'https://api.pickpoint.io/v1/reverse ' | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
222692
100
7215
195