Class: SearchGeoportailParcelle

ol.control. SearchGeoportailParcelle

Search places using the French National Base Address (BAN) API.


new SearchGeoportailParcelle(options)

Parameters:
Name Type Description
options any

extend ol.control.SearchJSON options

Properties
Name Type Argument Description
className string

control class name

apiKey boolean | undefined <optional>

the service api key.

authentication: string | undefined

basic authentication for the service API as btoa("login:pwd")

target Element | string | undefined

Specify a target if you want the control to be rendered outside of the map's viewport.

label string | undefined

Text label to use for the search button, default "search"

placeholder string | undefined

placeholder for city input, default "Choisissez une commune..."

prefixlabel string | undefined

label for prefix input, default "Préfixe"

sectionLabel string | undefined

label for section input, default "Section"

numberLabel string | undefined

label for number input, default "Numéro"

arrondLabel string | undefined

label for arrondissement, default "Arrond."

typing number | undefined

a delay on each typing to start searching (ms), default 500.

minLength integer | undefined

minimum length to start searching, default 3

maxItems integer | undefined

maximum number of items to display in the autocomplete list, default 10

pageSize Number

item per page for parcelle list paging, use -1 for no paging, default 5

See:
Fires:
  • event:commune
  • event:parcelle

Extends

Members


_history

Current history

Inherited From:
Overrides:

Methods


_getTitleTxt(f)

Returns title as text

Parameters:
Name Type Description
f any

feature to be displayed

Inherited From:
Overrides:
Returns:
Type
string

activateParcelle(b)

Activate parcelle inputs

Parameters:
Name Type Description
b bolean

ajax(url, data, cback)

Send ajax request

Parameters:
Name Type Description
url string
data *
cback function

a callback function that takes an array of {name, feature} to display in the autocomplete field

Inherited From:
Overrides:

autocomplete(s, cback)

Autocomplete function (ajax request to the server)

Parameters:
Name Type Description
s string

search string

cback function

a callback function that takes an array of {name, feature} to display in the autocomplete field

Inherited From:
Overrides:

clearHistory()

Remove previous history

Inherited From:
Overrides:

clearParcelList()

Clear the parcel list


collapse( [b])

Collapse the search

Parameters:
Name Type Argument Default Description
b boolean <optional>
true
Inherited From:
Overrides:

equalFeatures(f1, f2)

Test if 2 features are equal

Parameters:
Name Type Description
f1 any
f2 any
Inherited From:
Overrides:
Returns:
Type
boolean

getHistory()

Get history table

Inherited From:
Overrides:

getInputField(what)

Get the input field

Parameters:
Name Type Description
what string

the search input id commune|arrond|prefix|section|numero, default commune

Overrides:
Returns:
Type
Element

getTitle(f)

Returns the text to be displayed in the menu

Parameters:
Name Type Description
f any

feature to be displayed

Inherited From:
Overrides:
Returns:

the text to be displayed in the index, default f.name

Type
string

handleResponse(response)

Handle server response to pass the features array to the display list

Parameters:
Name Type Description
response any

server response

Inherited From:
Overrides:
Returns:

an array of feature

Type
Array.<any>

requestData(s)

Parameters:
Name Type Description
s string

the search string

Inherited From:
Overrides:
Returns:

request data (as key:value)

Type
Object

restoreHistory()

Restore history (from the localstorage)

Inherited From:
Overrides:

reverseGeocode(coord, cback)

Reverse geocode

Parameters:
Name Type Description
coord ol.coordinate
cback function | undefined

a callback function, default trigger a select event

Inherited From:
Overrides:

saveHistory()

Save history (in the localstorage)

Inherited From:
Overrides:

Force search to refresh

Inherited From:
Overrides:

searchParcelle(search, success, error)

Send search request for a parcelle number

Parameters:
Name Type Description
search string

search parcelle number

success function

callback function called on success

error function

callback function called on error


select(f, reverse, coord, options)

A line has been clicked in the menu > dispatch event

Parameters:
Name Type Description
f any

the feature, as passed in the autocomplete

reverse boolean

true if reverse geocode

coord ol.coordinate
options *

options passed to the event

Inherited From:
Overrides:

setInput(value, search)

Set the input value in the form (for initialisation purpose)

Parameters:
Name Type Description
value string
search boolean

to start a search

Inherited From:
Overrides:

setMap(map)

Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.

Parameters:
Name Type Description
map ol.Map

Map.

Inherited From:
Overrides:

setParcelle(p, search)

Set the input parcelle

Parameters:
Name Type Description
p *

parcel

Properties
Name Type Description
Commune string
CommuneAbsorbee string
Section string
Numero string
search boolean

start a search