L.Control.NorkartSearch is a [Leaflet][1] plugin for using the address search from Norkart. Requires an API-key.
npm install leaflet-norkartsearchsearch:select` event on the map when a hit is selected.
map.on('search:select', function(event) {
var position = event.position; // a L.latLng
var element = event.element; // The raw data from the search API
});
$3
Make sure to have the following components available on your page
- [Leaflet][1]
- [Bootstrap][3] (css only)
- [Reqwest][4]
- [React & ReactDOM][5]
[1]: http://leafletjs.com
[2]: http://leafletjs.com/reference.html#control-positions
[3]: http://getbootstrap.com
[4]: https://github.com/ded/reqwest
[5]: https://facebook.github.io/react/downloads.html
And include the `L.Control.NorkartSearch.js` and `L.Control.NorkartSearch.css` from `/build/`.
See `demo/index.html` for an example.
$3
Install:
npm install @norkart/leaflet-norkartsearch --save
In code:
require('leaflet-norkartsearch');
$3
See for a simple example
$3
##### Install dependencies:
`npm install`
##### Run code:
Run the demo code by running:
`npm start` and go to `localhost:8080``