-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
2,806 additions
and
1,791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: Geocode Earth | ||
menu: Providers | ||
route: /providers/geocode-earth | ||
--- | ||
|
||
import Playground from '../components/Playground'; | ||
import Map from '../components/Map'; | ||
|
||
# Geocode Earth Provider | ||
|
||
Geocode Earth is a hosted version of Pelias run by the core maintainers of the FOSS project. | ||
|
||
**note**: Geocode Earth services require an API key, grab a [free trial key][1] from their website. | ||
|
||
For more options and configurations, see the [documentation][2]. | ||
|
||
<Playground> | ||
<Map provider="GeocodeEarth" /> | ||
</Playground> | ||
|
||
```js | ||
import { GeocodeEarthProvider } from 'leaflet-geosearch'; | ||
|
||
// grab an API key from https://geocode.earth | ||
const provider = new GeocodeEarthProvider({ | ||
params: { | ||
api_key: '__YOUR_GEOCODE_EARTH_KEY__', | ||
}, | ||
}); | ||
|
||
// add to leaflet | ||
import { GeoSearchControl } from 'leaflet-geosearch'; | ||
|
||
map.addControl( | ||
new GeoSearchControl({ | ||
provider, | ||
style: 'bar', | ||
}), | ||
); | ||
``` | ||
|
||
## Optional parameters | ||
|
||
Geocode Earth supports a wide range of number of [optional parameters][2] which can be applied to every request using the `params` object: | ||
|
||
```js | ||
const provider = new GeocodeEarthProvider({ | ||
params: { | ||
size: 5, // limit the total number of results returned | ||
lang: 'nl', // render results in Dutch | ||
'boundary.country': 'NL', // limit search results to the Netherlands | ||
layers: 'address,street', // limmit which layers are queried | ||
}, | ||
}); | ||
``` | ||
|
||
Or individually on a per-request basis: | ||
|
||
```js | ||
const results = await provider.search({ | ||
query: { | ||
text: 'example', | ||
'focus.point.lat': 1.11, // score results nearer to the focus point higher | ||
'focus.point.lon': 2.22, | ||
}, | ||
}); | ||
``` | ||
|
||
[1]: https://geocode.earth/ | ||
[2]: https://geocode.earth/docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: Pelias | ||
menu: Providers | ||
route: /providers/pelias | ||
--- | ||
|
||
import Playground from '../components/Playground'; | ||
import Map from '../components/Map'; | ||
|
||
# Pelias Provider | ||
|
||
[Pelias][1] is an open-source geocoder powered completely by open data, available freely to everyone. | ||
|
||
In order to use this provider you'll need to have your own Pelias server running. | ||
|
||
The [Docker][3] repository provides the quickest path to running your own server. | ||
|
||
See the [Pelias documentation][2] for more detailed information about the available endpoints and query parameters. | ||
|
||
Looking for a hosted version of Pelias? check out the Geocode Earth provider. | ||
|
||
<Playground> | ||
<Map provider="Pelias" /> | ||
</Playground> | ||
|
||
```js | ||
import { PeliasProvider } from 'leaflet-geosearch'; | ||
|
||
// Pelias servers are self-hosted so you'll need to configure the 'options.host' string | ||
// to identify where requests to your running pelias/api server instance should be sent. | ||
// note: you SHOULD include the scheme, domain and port but NOT any path or parameters. | ||
const provider = new PeliasProvider({ host: 'http://localhost:4000' }); | ||
|
||
// add to leaflet | ||
import { GeoSearchControl } from 'leaflet-geosearch'; | ||
|
||
map.addControl( | ||
new GeoSearchControl({ | ||
provider, | ||
style: 'bar', | ||
}), | ||
); | ||
``` | ||
|
||
## Optional parameters | ||
|
||
Pelias supports a wide range of number of [optional parameters][4] which can be applied to every request using the `params` object: | ||
|
||
```js | ||
const provider = new PeliasProvider({ | ||
params: { | ||
size: 5, // limit the total number of results returned | ||
lang: 'nl', // render results in Dutch | ||
'boundary.country': 'NL', // limit search results to the Netherlands | ||
layers: 'address,street', // limmit which layers are queried | ||
}, | ||
}); | ||
``` | ||
|
||
Or individually on a per-request basis: | ||
|
||
```js | ||
const results = await provider.search({ | ||
query: { | ||
text: 'example', | ||
'focus.point.lat': 1.11, // score results nearer to the focus point higher | ||
'focus.point.lon': 2.22, | ||
}, | ||
}); | ||
``` | ||
|
||
[1]: https://github.com/pelias/pelias | ||
[2]: https://github.com/pelias/documentation | ||
[3]: https://github.com/pelias/docker | ||
[4]: https://github.com/pelias/documentation/blob/master/autocomplete.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.