leaflet-geocoder-ban
Advanced tools
Comparing version
{ | ||
"name": "leaflet-geocoder-ban", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# leaflet-geocoder-ban [](https://www.npmjs.com/package/leaflet-geocoder-ban)  | ||
A simple Leaflet Plugin to add a geocoding control to your map, powered by the french [BAN](https://adresse.data.gouv.fr/) (Base Adresse Nationale) API. This API only covers French addresses. | ||
Check the online [demo](https://eig-2017.github.io/leaflet-geocoder-ban/demo/). | ||
Check the online [demo](https://entrepreneur-interet-general.github.io/leaflet-geocoder-ban/demo/). | ||
@@ -61,3 +61,3 @@ # Installation | ||
## custom markgeocode function | ||
# Custom markgeocode function | ||
When you select a result on the geocoder, it calls a default `markGeocode` function. If you want to call a custom function, override it. It receives as argument the result given by the BAN API as described [here](https://adresse.data.gouv.fr/api) | ||
@@ -79,1 +79,20 @@ | ||
``` | ||
# Methods | ||
| method | description | | ||
|------------------|-----------------------------| | ||
| collapse() | collapses the geocoder | | ||
| expand() | expands the geocoder | | ||
| toggle() | toggles between expanded and collapsed state | | ||
| remove() | removes the geocoder | | ||
## example | ||
```javascript | ||
var geocoder = L.geocoderBAN().addTo(map) | ||
map.on('contextmenu', function () { | ||
geocoder.toggle() | ||
}) | ||
``` |
Sorry, the diff of this file is not supported yet
97
24.36%16606
-45.79%8
-33.33%308
-58.04%