Septima.Search.GeoSearch
Extends Septima.Search.Searcher
Searches gst geoservice (https://docs.dataforsyningen.dk/#gsearch-dokumentation)
Options
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
kommunekode | String | * | "*" Search all municipalities (Default)<br/> Search specific municipalities eg. "101" or "101 256" | |
targets | Array.<string> | Yes | List of targets to search<br/> The full list is ['kommuner', 'matrikelnumre', 'opstillingskredse', 'politikredse', 'postdistrikter', 'regioner', 'retskredse', 'sogne', 'matrikelnumre_udgaaet']<br/> ['*'] is short hand for ['kommuner', 'matrikelnumre', 'opstillingskredse', 'politikredse', 'postdistrikter', 'regioner', 'retskredse', 'sogne'] | |
authParamsKortforsyningen | Object | Yes | Either {token: 'ttttt'}, where t is a ticket issued by kortforsyningen or {login: 'llll', password: 'pppp'} | |
authParamsDatafordeleren | Object | Yes | Tjenestebruger til Datafordeleren {username: 'uuuu', password: 'pppp'} |
Examples
Usage
YAML Declaration:
_type: Septima.Search.GeoSearch
_options:
targets:
- matrikelnumre
- sogne
authParamsKortforsyningen:
token: xxxx
authParamsDatafordeleren:
username: xxxx
password: xxxx
kommunekode: '101 157'
JS options:
geoSearchOptions = {
"targets": ['matrikelnumre', 'sogne'],
"authParamsKortforsyningen": {
"token": 'xxxxx'
},
"authParamsDatafordeleren": {
"username": 'xxxxx',
"password": 'xxxx'
},
kommunekode: '157 101'
};
js client:
<!-- Include septimaSearch -->
<script type="text/javascript" src="http://search.cdn.septima.dk/{version}/septimasearch.min.js"/>
controller.addSearcher(new Septima.Search.GeoSearch(geoSearchOptions))
ES6:
import GeoSearch from './searchers/GeoSearch.js'
controller.addSearcher(new GeoSearch(geoSearchOptions))