Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fchabouis authored Sep 27, 2018
1 parent c6f87f2 commit 2286cc4
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ Check the online demos : [demo1](https://entrepreneur-interet-general.github.io/

# Installation

You can either:
* install with npm `npm install --save leaflet-geocoder-ban`
## With NPM
Install with npm `npm install --save leaflet-geocoder-ban`

or

* clone the git repository

# Usage
First, load the leaflet files as usual.

Then, load the two leaflet-geocoder-ban files : the js and the css.
and import the files :
```
import 'leaflet-geocoder-ban/dist/leaflet-geocoder-ban.min.css'
import 'leaflet-geocoder-ban/dist/leaflet-geocoder-ban.js'
```

They are located in the src folder and minified versions are provided in the dist folder. You can load them directly in your html page :
## Manually

Clone the git repository or manually download the js and css files from the dist folder and load them :
```html
<script src="leaflet-geocoder-ban.js"></script>
<script src="leaflet-geocoder-ban.min.js"></script>
<link rel="stylesheet" href="leaflet-geocoder-ban.css">
```

# Usage
In your javascript code, create a Leaflet map:
```javascript
var map = L.map('mapid').setView([45.853459, 2.349312], 6)
Expand All @@ -37,6 +36,8 @@ And add the geocoder:
var geocoder = L.geocoderBAN().addTo(map)
```

That's it !

# Options
You can pass some options to the `geocoderBAN()` function:

Expand Down Expand Up @@ -113,3 +114,5 @@ Customization of the search bar CSS is available through the searchBar class. Fo
max-width: 500px;
}
```
Have a look at the [demo2](https://entrepreneur-interet-general.github.io/leaflet-geocoder-ban/demo/demo_search_bar.html) code for a more complete customization example.

0 comments on commit 2286cc4

Please sign in to comment.