react-autosuggest-geocoder
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "react-autosuggest-geocoder", | ||
"description": "Autosuggest addresses using a Pelias service.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": "https://github.com/abec/react-autosuggest-geocoder", | ||
@@ -78,3 +78,4 @@ "main": "src/index.js", | ||
"react-component", | ||
"mapzen" | ||
"mapzen", | ||
"geocode.earth" | ||
], | ||
@@ -81,0 +82,0 @@ "files": [ |
@@ -7,2 +7,4 @@ # react-autosuggest-geocoder | ||
Thank you to the team at [https://geocode.earth](https://geocode.earth) for lending a pelias service for the demo! | ||
## Setup / Usage | ||
@@ -44,3 +46,3 @@ | ||
<ReactAutosuggestGeocoder | ||
url='https://search.mapzen.com/v1' | ||
url='https://api.geocode.earth/v1' | ||
apiKey='...' | ||
@@ -64,8 +66,8 @@ onSuggestionSelected={(event, { search, suggestion, method }) => { | ||
| :--- | :--- | :---: | :--- | :--- | | ||
| url | string | ✓ | https://search.mapzen.com/v1 | | | ||
| apiKey | string | ✓ | | Pelias service API key. Most useful with MapZen. See https://mapzen.com/developers to get a mapzen API key. | | ||
| sources | string | ✓ | openaddresses | Filter data by data source. See https://mapzen.com/documentation/search/search/#filter-by-data-source for more information. | | ||
| url | string | ✓ | https://api.geocode.earth/v1 | | | ||
| apiKey | string | ✓ | | Pelias service API key. Most useful with geocode.earth. See https://geocode.earth/ to get an API key. | | ||
| sources | string | ✓ | openaddresses | Filter data by data source. | | ||
| fetchDelay | number | ✓ | 150 | Debounce API requests with this delay (in milliseconds). | | ||
| center | object | | | Orient search results towards the provided center. See https://mapzen.com/documentation/search/search/#prioritize-results-by-proximity for more detail. | | ||
| bounds | array | | | Bounding box to limit search results. See https://mapzen.com/documentation/search/search/#search-within-a-rectangular-region for more detail. | | ||
| center | object | | | Orient search results towards the provided center. | | ||
| bounds | array | | | Bounding box to limit search results. | | ||
| onSuggestionSelected | function | | | See https://github.com/moroshko/react-autosuggest#onSuggestionSelectedProp for details. | | ||
@@ -102,1 +104,4 @@ | onReverseSelected | function | | | Invoked after reverse geocoding is performed. | | ||
## Special Thanks | ||
To the folks at https://geocode.earth for their continued work on Pelias. |
@@ -1,2 +0,1 @@ | ||
import * as _ from 'lodash'; | ||
@@ -6,3 +5,2 @@ import React from 'react'; | ||
import fetch from 'node-fetch'; | ||
import Autosuggest from 'react-autosuggest'; | ||
@@ -30,3 +28,3 @@ | ||
static defaultProps = { | ||
url: 'https://search.mapzen.com/v1', | ||
url: 'https://api.geocode.earth/v1', | ||
sources: 'openaddresses', | ||
@@ -101,4 +99,3 @@ apiKey: null, | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json' | ||
'Accept': 'application/json' | ||
} | ||
@@ -122,4 +119,3 @@ }).then(response => response.json()); | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json' | ||
'Accept': 'application/json' | ||
} | ||
@@ -143,4 +139,3 @@ }).then(response => response.json()); | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json' | ||
'Accept': 'application/json' | ||
} | ||
@@ -147,0 +142,0 @@ }).then(response => response.json()); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3563748
40523
104