Hierarchy (View Summary)

Constructors

  • Parameters

    • options: {
          apiKey?: string;
          autocompleteOptions?: any;
          collapsed?: boolean;
          draggable?: boolean;
          exclusions?: any;
          export?: any;
          graphs?: any[];
          id?: number;
          layerDescription?: { description?: string; title?: string };
          markersOpts?: { offset?: any[]; url?: string };
          routeOptions?: any;
          ssl?: boolean;
      }

      route control options

      • OptionalapiKey?: string

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

      • OptionalautocompleteOptions?: any

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

      • Optionalcollapsed?: boolean

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

      • Optionaldraggable?: boolean

        Specify if widget is draggable

      • Optionalexclusions?: any

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

      • Optionalexport?: any

        Specify if button "Export" is displayed. For the use of the options of the "Export" control, see packages/Controls/Export/Export.default

      • Optionalgraphs?: any[]

        list of resources, by default : ["Voiture", "Pieton"]. The first element is selected.

      • Optionalid?: number

        Ability to add an identifier on the widget (advanced option)

      • OptionallayerDescription?: { description?: string; title?: string }

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

        • Optionaldescription?: string

          Layer description to be displayed in LayerSwitcher

        • Optionaltitle?: string

          Layer title to be displayed in LayerSwitcher

      • OptionalmarkersOpts?: { offset?: any[]; url?: string }

        options to use your own markers. Object properties can be "departure", "stages" or "arrival". Corresponding value is an object with following properties :

        • Optionaloffset?: any[]

          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)

        • Optionalurl?: string

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

      • OptionalrouteOptions?: any

        route service options. see Gp.Services.route() to know all route options.

      • Optionalssl?: boolean

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

    Returns Route

    route:drawstart

    route:drawend

    route:compute

    route:compute

    route:newresults

    var route = ol.control.Route({
    "collapsed" : true
    "draggable" : true,
    "export" : false,
    "exclusions" : {
    "toll" : true,
    "bridge" : false,
    "tunnel" : true
    },
    "graphs" : ['Pieton', 'Voiture'],
    "markersOpts" : {
    "departure" : {
    "url" : "...",
    "offset" : [0,0]
    },
    "stages" : {
    "url" : "...",
    "offset" : [0,0]
    },
    "arrival" : {
    "url" : "...",
    "offset" : [0,0]
    }
    }
    "autocompleteOptions" : {},
    "routeOptions" : {}
    });

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

Properties

_container: any
_defaultFeatureStyle: undefined | Style
_selectedFeatureStyle: undefined | Style
collapsed: undefined | boolean
description: any
disposed: boolean

The object has already been disposed.

draggable: undefined | boolean
element: any
listable: boolean
listenerKeys: EventsKey[]
on: ObjectOnSignature<EventsKey>
once: ObjectOnSignature<EventsKey>
options:
    | undefined
    | {
        autocompleteOptions: {};
        collapsed: boolean;
        draggable: boolean;
        exclusions: { bridge: boolean; toll: boolean; tunnel: boolean };
        export: boolean;
        graphs: string[];
        layerDescription: { description: string; title: string };
        routeOptions: {};
    }
un: ObjectOnSignature<void>

Methods

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • Protected

    Apply any properties from another object without triggering events.

    Parameters

    • source: BaseObject

      The source object.

    Returns void

  • Increases the revision counter and dispatches a 'change' event.

    Returns void

  • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

    Parameters

    • event: string | BaseEvent

      Event object.

    Returns undefined | boolean

    false if anyone called preventDefault on the event object or if any of the listeners returned false.

  • Clean up.

    Returns void

  • Protected

    Extension point for disposable objects.

    Returns void

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

  • Get a list of object property names.

    Returns string[]

    List of property names.

  • Get vector layer where geoJson route is drawn

    Returns VectorLayer<VectorSource<any>, any>

    layer - ol.layer.Vector route layer

  • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

    Parameters

    • type: string

      Type.

    Returns undefined | Listener[]

    Listeners.

  • Get the map associated with this control.

    Returns null | Map

    Map.

  • Get an object of all property names and values.

    Returns { [x: string]: any }

    Object.

  • Get an object of all property names and values.

    Returns null | { [x: string]: any }

    Object.

  • Get the version number for this object. Each time the object is modified, its version number will be incremented.

    Returns number

    Revision.

  • Parameters

    • Optionaltype: string

      Type. If not provided, true will be returned if this event target has any listeners.

    Returns boolean

    Has listeners.

  • Returns boolean

    The object has properties.

  • Parameters

    • key: string

      Key name.

    • oldValue: any

      Old value.

    Returns void

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: (arg0: Event | BaseEvent) => unknown

      Listener.

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: (arg0: Event | BaseEvent) => unknown

      Listener.

    Returns EventsKey | EventsKey[]

    Event key.

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • Renders the control.

    Parameters

    • mapEvent: MapEvent

      Map event.

    Returns void

  • Sets a value.

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Collapse or display widget main container

    Parameters

    • collapsed: boolean

      True to collapse widget, False to display it

    Returns void

  • Set route data

    Parameters

    • data: {
          computation: string;
          exclusions: any[];
          points: any[];
          results: any;
          transport: string;
      }

      control informations

      • computation: string

        computation type

      • exclusions: any[]

        list of exclusions

      • points: any[]

        list of points : [[lon, lat]]

      • results: any

        service response

      • transport: string

        transport type

    Returns void

  • Set vector layer where route geometry is drawn

    Parameters

    • layer: VectorLayer<VectorSource<any>, any>

      ol.layer.Vector route layer

    Returns void

  • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

    Parameters

    • values: { [x: string]: any }

      Values.

    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • This function is used to set a target element for the control. It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control). If no target is set in the options passed to the control constructor and if setTarget is not called then the control is added to the map's overlay container.

    Parameters

    • target: string | HTMLElement

      Target.

    Returns void

  • Protected

    Unlisten for a certain type of event.

    Parameters

    • type: string | string[]

      Type.

    • listener: (arg0: Event | BaseEvent) => unknown

      Listener.

    Returns void

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optionalsilent: boolean

      Unset without triggering an event.

    Returns void