Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
react-autosuggest-geocoder
Advanced tools
react-autosuggest with suggestions from pelias services. Click here to try it out.
Through NPM:
npm install --save react-autosuggest-geocoder
Through Yarn:
yarn add react-autosuggest-geocoder
import { ReactAutosuggestGeocoder } from 'react-autosuggest-geocoder'
class SearchPage extends React.Component {
constructor(props) {
super(props);
this.state = {
search: "",
latitude: Infinity,
longitude: Infinity
};
}
render() {
return (
<div>
<ReactAutosuggestGeocoder
url='https://search.mapzen.com/v1'
apiKey='...'
onSuggestionSelected={(event, { search, suggestion, method }) => {
this.setState({
location: suggestion.properties.label,
latitude: suggestion.geometry.coordinates[1],
longitude: suggestion.geometry.coordinates[0]
})
}} />
</div>
);
}
}
Prop | Type | Required | Default | Description |
---|---|---|---|---|
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. |
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. | ||
onSuggestionSelected | function | See https://github.com/moroshko/react-autosuggest#onSuggestionSelectedProp for details. | ||
onReverseSelected | function | Invoked after reverse geocoding is performed. | ||
getSuggestionValue | function | ✓ | Identity Function | See https://github.com/moroshko/react-autosuggest#getsuggestionvalue-required for details. |
renderSuggestion | function | ✓ | Div Wrapper Function | See https://github.com/moroshko/react-autosuggest#rendersuggestion-required for details. |
Reverse geocode the given point into the component input text field.
Update the autocomplete input text field.
Clear the autocomplete input text field and deselect any previously selected values.
Bring browser focus to the autocomplete input text field.
Unfocus browser from the autocomplete input text field.
BSD-3
FAQs
Autosuggest addresses using a Pelias service.
We found that react-autosuggest-geocoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.