L.Control.NorkartSearch is a [Leaflet][1] plugin for using the address search from Norkart. Requires an API-key.


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
03Jul 25, 2018Jul 8, 2016Minified + gzip package size for @norkart/leaflet-norkartsearch in KB



L.Control.NorkartSearch is a Leaflet plugin for using the address search from Norkart. Requires an API-key.


    apiKey: 'MY_API_KEY'


option Type Default Description
apiKey string none an api key from Norkart
position leaflet control position 'topright' position of the leaflet control
placeholder string Søk placeholder text for search box
showMarker boolean true Wether or not to show a marker in the map when a hit is selected
limits array undefined array of municipality id's (kommunenummer) to limit search to
targets array ['matrikkelenhet', 'gateadresse'] target names that determines what type of search the engine supports. Supported targets are: 'matrikkelenhet', 'gateadresse', 'stedsnavn' (and more, see fritektsook api).


the plugin triggers a ```search: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

As a standalone component

Make sure to have the following components available on your page

And include the L.Control.NorkartSearch.js and L.Control.NorkartSearch.css from /build/.

See demo/index.html for an example.

As an npm-module


npm install @norkart/leaflet-norkartsearch --save

In code:



See https://norkart.github.io/L.Control.NorkartSearch/demo/ for a simple example


Install dependencies:

npm install

Run code:

Run the demo code by running: npm start and go to localhost:8080

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.