Hierarchy (View Summary)

Constructors

  • Parameters

    • options: {
          active?: boolean;
          apiKey?: string;
          displayProfileOptions?: {
              apply?: Function;
              ascendingElevation?: boolean;
              currentSlope?: boolean;
              descendingElevation?: boolean;
              greaterSlope?: boolean;
              meanSlope?: boolean;
              target?: any;
              totalDistance?: boolean;
          };
          elevationOptions?: any;
          export?: any;
          id?: number;
          layerDescription?: { description?: string; title?: string };
          ssl?: boolean;
          stylesOptions?: {
              draw?: { finish?: any; pointer?: any; start?: any };
              marker?: any;
          };
      }

      options for function call.

      • Optionalactive?: boolean

        specify if control should be actived at startup. Default is false.

      • OptionalapiKey?: string

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

      • OptionaldisplayProfileOptions?: {
            apply?: Function;
            ascendingElevation?: boolean;
            currentSlope?: boolean;
            descendingElevation?: boolean;
            greaterSlope?: boolean;
            meanSlope?: boolean;
            target?: any;
            totalDistance?: boolean;
        }

        profile options.

        • Optionalapply?: Function

          function to display profile if you want to cutomise it. By default, (DISPLAY_PROFILE_BY_DEFAULT()) is used. Helper functions to use with D3 (DISPLAY_PROFILE_LIB_D3()) or AmCharts (DISPLAY_PROFILE_LIB_AMCHARTS()) frameworks are also provided. You may also provide your own function.

        • OptionalascendingElevation?: boolean

          display the ascending elevation into the graph

        • OptionalcurrentSlope?: boolean

          display current slope value on profile mouseover

        • OptionaldescendingElevation?: boolean

          display the descending elevation into the graph

        • OptionalgreaterSlope?: boolean

          display the greater slope into the graph

        • OptionalmeanSlope?: boolean

          display the mean slope into the graph

        • Optionaltarget?: any

          DOM container to use to display the profile.

        • OptionaltotalDistance?: boolean

          display the total distance of the path

      • OptionalelevationOptions?: any

        elevation path service options. See Gp.Services.getAltitude() for available options

      • Optionalexport?: any

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

      • 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

      • Optionalssl?: boolean

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

      • OptionalstylesOptions?: { draw?: { finish?: any; pointer?: any; start?: any }; marker?: any }

        styles management

        • Optionaldraw?: { finish?: any; pointer?: any; start?: any }

          styles used when drawing. Specified with following properties.

          • Optionalfinish?: any

            Line Style when finished drawing. Specified with an ol.style.Stroke object.

          • Optionalpointer?: any

            Style for mouse pointer when drawing the line. Specified with an ol.style.Image subclass object.

          • Optionalstart?: any

            Line Style when drawing. Specified with an ol.style.Stroke object.

        • Optionalmarker?: any

          styles management of marker displayed on map when the user follows the elevation path. Specified with an ol.style.Image subclass object

    Returns ElevationPath

    elevationpath:drawstart

    elevationpath:drawend

    elevationpath:compute

    export:compute

    var measure = new ol.control.ElevationPath({
    export : false,
    stylesOptions : {
    draw : {
    finish : new ol.style.Stroke({
    color : "rgba(0, 0, 0, 0.5)",
    width : 2
    })
    },
    }
    displayProfileOptions : {
    apply : ol.control.ElevationPath.DISPLAY_PROFILE_RAW,
    }
    });

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

    Exemples :
    - displayProfileOptions.apply : null
    - displayProfileOptions.apply : function (elevations, container, context) { // do some stuff... }
    - displayProfileOptions.apply : ol.control.ElevationPath.DISPLAY_PROFILE_{LIB_AMCHARTS | LIB_D3 | RAW}

Properties

_container: HTMLElement
_currentSketch: null | Feature<Geometry>
_data: {}
_drawStyleFinish: null | Style
_drawStyleStart: null | Style
_infoContainer: any
_lastSketch: null | Feature<Geometry>
_marker: any
_markerStyle: null | Style
_measureDraw: null | Draw
_measureSource: null | VectorSource<any> | VectorSource<Feature<Geometry>>
_measureVector:
    | null
    | VectorLayer<VectorSource<any>, any>
    | VectorLayer<VectorSource<any> | VectorSource<Feature<Geometry>>, any>
_panelContainer: any
_pictoButton: any
_profile: any
_profileContainer: any
_showContainer: any
_timerHdlr: null | Timeout
_uid: number
_waitingContainer: any
collapsed: undefined | boolean
description: any
disposed: boolean

The object has already been disposed.

element: HTMLElement
listable: boolean
listenerKeys: EventsKey[]
on: ObjectOnSignature<EventsKey>
once: ObjectOnSignature<EventsKey>
options:
    | undefined
    | {
        active: boolean;
        apiKey: null;
        displayProfileOptions: {
            apply: null;
            ascendingElevation: boolean;
            currentSlope: boolean;
            descendingElevation: boolean;
            greaterSlope: boolean;
            meanSlope: boolean;
            target: null;
            totalDistance: boolean;
        };
        elevationOptions: { outputFormat: string };
        export: boolean;
        layerDescription: { description: string; title: string };
        render: null;
        stylesOptions: { draw: null; marker: null; profile: null };
        target: null;
    }
un: ObjectOnSignature<void>
_profile: undefined | HTMLElement
DEFAULT_STYLES: {
    MARKER: Icon;
    RESULTS: {
        imageFillColor: string;
        imageRadius: number;
        imageStrokeColor: string;
        imageStrokeWidth: number;
    };
} = ...

Styles applied by default if stylesOptions property is not set.

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 elevation data

    Returns any

    data - elevations

    {
    * type // "elevationpath"
    * greaterSlope // pente max
    * meanSlope // pente moyenne
    * distancePlus // distance cumulée positive
    * distanceMinus // distance cumulée négative
    * ascendingElevation // dénivelé cumulée positive
    * descendingElevation // dénivelé cumulée négative
    * altMin // altitude min
    * altMax // altitude max
    * distance // distance totale
    * unit // unité des mesures de distance
    * points // elevations
    * }
  • Get a list of object property names.

    Returns string[]

    List of property names.

  • 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

  • Set profile data

    Parameters

    • data: any

      elevations

    Returns void

    {
    * greaterSlope // pente max
    * meanSlope // pente moyenne
    * distancePlus // distance cumulée positive
    * distanceMinus // distance cumulée négative
    * ascendingElevation // dénivelé cumulée positive
    * descendingElevation // dénivelé cumulée négative
    * altMin // altitude min
    * altMax // altitude max
    * distance // distance totale
    * unit // unité des mesures de distance
    * points // elevations
    * }
  • 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

  • Display Profile function used by default : no additonal framework needed.

    Parameters

    • data: any

      elevations values for profile

    • container: HTMLElement

      html container where to display profile

    • context: any

      this control object

    Returns void

  • display Profile using Amcharts framework. This method needs AmCharts libraries to be loaded.

    Parameters

    • data: any

      collection elevations

    • container: HTMLElement

      container

    • context: any

      this control object

    Returns void

  • display Profile using D3 javascript framework. This method needs D3 libraries to be loaded.

    Parameters

    • data: any

      elevations values for profile

    • container: HTMLElement

      html container where to display profile

    • context: any

      this control object

    Returns void

  • display Profile without graphical rendering (raw service response)

    Parameters

    • data: any

      elevations values for profile

    • container: HTMLElement

      html container where to display profile

    • context: any

      this control object

    Returns void

Events

COMPUTE_ELEVATION_EVENT: undefined | string

event triggered when the compute is finished

elevationpath:compute

"elevationpath:compute"
ElevationPath.on("elevationpath:compute", function (e) {
console.log(e.target.getData());
})
DRAW_END_ELEVATION_EVENT: undefined | string

event triggered at the end of drawing input

elevationpath:drawend

"elevationpath:drawend"
DRAW_START_ELEVATION_EVENT: undefined | string

event triggered at the start of drawing input

elevationpath:drawstart

"elevationpath:drawstart"