Geoportal Extension for OpenLayers API Reference

Class: Isocurve

ol.control.Isocurve

Isocurve Control.

new Isocurve(options)

OpenLayers/Controls/Isocurve.js, line 96
Name Type Description
options Object

Isocurve control options

Name Type Default Description
apiKey String optional

API key for services call (isocurve and autocomplete services). The key "calcul" is used by default.

ssl Boolean true optional

use of ssl or not (default true, service requested using https protocol)

collapsed Boolean true optional

Specify if widget has to be collapsed (true) or not (false) on map loading. Default is true.

draggable Boolean false optional

Specify if widget is draggable

export Boolean | Object false optional

Specify if button "Export" is displayed. For the use of the options of the "Export" control, see ol.control.Export

exclusions Object {"toll" : false, "tunnel" : false, "bridge" : false} optional

list of exclusions with status (true = checked). By default : no exclusions checked.

graphs Array ["Voiture", "Pieton"] optional

list of graph resources to be used for isocurve calculation, by default : ["Voiture", "Pieton"]. Possible values are "Voiture" and "Pieton". The first element is selected.

methods Array ["time", "distance"] optional

list of methods, by default : ["time", "distance"]. Possible values are "time" and "distance". The first element is selected by default.

directions Array ["departure", "arrival"] optional

list of directions to be displayed, by default : ["departure", "arrival"]. The first element is selected by default. Possible values are "departure" and "arrival".
Directions enable to specify if input location point will be used as a departure point ("departure") or as an arrival point ("arrival")

isocurveOptions Object {} optional

isocurve service options. see Gp.Services.isoCurve() to know all isocurve options.

autocompleteOptions Object {} optional

autocomplete service options. see Gp.Services.autoComplete() to know all autocomplete options

markerOpts Object optional

options to use your own marker. Default is a lightOrange marker.

Name Type Description
url String optional

marker base64 encoded url (ex "data:image/png;base64,...""). Mandatory for a custom marker

offset Array optional

Offsets in pixels used when positioning the overlay. The first element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0]. (see http://openlayers.org/en/latest/apidoc/ol.Overlay.html)

layerDescription Object {} optional

Layer informations to be displayed in LayerSwitcher widget (only if a LayerSwitcher is also added to the map)

Name Type Default Description
title String "Isochrone/Isodistance" optional

Layer title to be displayed in LayerSwitcher

description String "isochrone/isodistance basé sur un graphe" optional

Layer description to be displayed in LayerSwitcher

Fires:
  • isocurve:drawstart
  • isocurve:drawend
  • isocurve:compute
  • export:compute
Example
var iso = ol.control.Isocurve({
     "collapsed" : false,
     "draggable" : true,
     "export"    : false,
     "methods" : ["time", "distance"],
     "exclusions" : {
        "toll" : true,
        "bridge" : false,
        "tunnel" : true
     },
     "graphs" : ["Pieton", "Voiture"],
     "markerOpts" : {
         "url" : "...",
         "offset" : [0,0]
     }
     "isocurveOptions" : {},
     "autocompleteOptions" : {}
 });

 // if you want to pluggued the control Export with options :
 var iso = new ol.control.Isocurve({
   export : {
     name : "export",
     format : "geojson",
     title : "Exporter",
     menu : false
   }
 });

Extends

  • ol.control.Control

Members

collapsed

{Boolean} specify if isocurve control is collapsed (true) or not (false)

draggable

{Boolean} specify if isocurve control is draggable (true) or not (false)

Methods

clean()

OpenLayers/Controls/Isocurve.js, line 451

Clean UI : reinit control

compute(position, value, options)

OpenLayers/Controls/Isocurve.js, line 352

This method is public.
It allows to control the execution of a traitment.

Name Type Description
position Array

position in the projection map [ x, y ]

value Object

distance in km or hours-minutes

options Object

options = {...}

getCollapsed(){Boolean}

OpenLayers/Controls/Isocurve.js, line 200

Returns true if widget is collapsed (minimized), false otherwise

Returns:
- true if widget is collapsed

getContainer(){DOMElement}

OpenLayers/Controls/Isocurve.js, line 331

Get container

getData(){Object}

OpenLayers/Controls/Isocurve.js, line 284

Get isocurve data

Returns:
- process results

getGeoJSON(){String}

OpenLayers/Controls/Isocurve.js, line 262

Get vector layer

Returns:
- GeoJSON format layer

getLayer(){Object}

OpenLayers/Controls/Isocurve.js, line 230

Get vector layer where Isocurve geometry is drawn

Returns:
- ol.layer.Vector isocurve layer

getStyle(){ol.style}

OpenLayers/Controls/Isocurve.js, line 340

Get default style

init()

OpenLayers/Controls/Isocurve.js, line 415

This method is public.
It allows to init the control.

setCollapsed(collapsed)

OpenLayers/Controls/Isocurve.js, line 209

Collapse or display widget main container

Name Type Description
collapsed Boolean

True to collapse widget, False to display it

setData(data)

OpenLayers/Controls/Isocurve.js, line 309

Set isocurve data

Name Type Description
data Object

control informations

Name Type Description
transport String

transport type

computation String

computation type

exclusions Array

list of exclusions

direction String

direction type

point Array

[lon, lat]

results Object

service response

setGeoJSON(geojson)

OpenLayers/Controls/Isocurve.js, line 271

Set vector layer

Name Type Description
geojson String

GeoJSON format layer

setLayer(layer)

OpenLayers/Controls/Isocurve.js, line 239

Set vector layer where Isocurve geometry is drawn

Name Type Description
layer Object

ol.layer.Vector isocurve layer

setMap(map)

OpenLayers/Controls/Isocurve.js, line 158

Overwrite OpenLayers setMap method

Name Type Description
map ol.Map

Map.