Hierarchy (View Summary)

Constructors

  • Parameters

    • options: {
          collapsed?: boolean;
          draggable?: boolean;
          id?: number;
          layerTypes?: any[];
          vectorStyleOptions?: {
              GeoJSON?: { defaultStyle?: any };
              GPX?: { defaultStyle?: any };
              KML?: {
                  defaultStyle?: any;
                  extractStyles?: boolean;
                  showPointNames?: boolean;
              };
              MapBox?: { defaultStyle?: any; display?: boolean; editor?: any };
          };
          webServicesOptions?: { noProxyDomains?: string[]; proxyUrl?: string };
      }

      options for function call.

      • Optionalcollapsed?: boolean

        Specify if LayerImport control should be collapsed at startup. Default is true.

      • Optionaldraggable?: boolean

        Specify if widget is draggable

      • Optionalid?: number

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

      • OptionallayerTypes?: any[]

        data types that could be imported : "KML", "GPX", "GeoJSON", "WMS", "WMTS" and "MAPBOX". Values will be displayed in the same order in widget list.

      • OptionalvectorStyleOptions?: {
            GeoJSON?: { defaultStyle?: any };
            GPX?: { defaultStyle?: any };
            KML?: {
                defaultStyle?: any;
                extractStyles?: boolean;
                showPointNames?: boolean;
            };
            MapBox?: { defaultStyle?: any; display?: boolean; editor?: any };
        }

        Options for imported vector layer styling (KML, GPX, GeoJSON)

        • OptionalGeoJSON?: { defaultStyle?: any }

          Options for GeoJSON layer styling

          • OptionaldefaultStyle?: any

            default style to be applied to GeoJSON imports in case no style is defined. defaultStyle is an ol.style.Style object.

        • OptionalGPX?: { defaultStyle?: any }

          Options for GPX layer styling

          • OptionaldefaultStyle?: any

            default style to be applied to GPX imports in case no style is defined. defaultStyle is an ol.style.Style object.

        • OptionalKML?: { defaultStyle?: any; extractStyles?: boolean; showPointNames?: boolean }

          Options for KML layer styling

          • OptionaldefaultStyle?: any

            default style to be applied to KML imports in case no style is defined. defaultStyle is an ol.style.Style object.

          • OptionalextractStyles?: boolean

            Extract styles from the KML. Default is true.

          • OptionalshowPointNames?: boolean

            Show names as labels for KML placemarks which contain points. Default is true.

        • OptionalMapBox?: { defaultStyle?: any; display?: boolean; editor?: any }

          Options for MapBox layer styling

          • OptionaldefaultStyle?: any

            default style to be applied to MapBox imports in case no style is defined. defaultStyle is an ol.style.Style object.

          • Optionaldisplay?: boolean

            display tools editor

          • Optionaleditor?: any

            options for tools editor

      • OptionalwebServicesOptions?: { noProxyDomains?: string[]; proxyUrl?: string }

        Options to import WMS or WMTS layers

        • OptionalnoProxyDomains?: string[]

          Proxy will not be used for this list of domain names. Only use if you know what you're doing.

        • OptionalproxyUrl?: string

          Proxy URL to avoid cross-domain problems. Mandatory to import WMS and WMTS layer.

    Returns LayerImport

    layerimport:mapbox:added

    layerimport:vector:added

    layerimport:service:added

    editor:loaded

    render:success

    render:failure

    var LayerImport = new ol.control.LayerImport({
    "collapsed" : false,
    "draggable" : true,
    "layerTypes" : ["KML", "GPX"],
    "webServicesOptions" : {
    "proxyUrl" : "http://localhost/proxy/php/proxy.php?url=",
    "noProxyDomains" : []
    },
    "vectorStyleOptions" : {
    "KML" : {
    extractStyles : true,
    defaultStyle : new ol.style.Style({
    image : new ol.style.Icon({
    src : "data:image/png;base64....",
    size : [51, 38],
    }),
    stroke : new ol.style.Stroke({
    color : "#ffffff",
    width : 7
    }),
    fill : new ol.style.Fill({
    color : "rgba(255, 183, 152, 0.2)"
    }),
    text : new ol.style.Text({
    font : "16px Sans",
    textAlign : "left",
    fill : new ol.style.Fill({
    color : "rgba(255, 255, 255, 1)"
    }),
    stroke : new ol.style.Stroke({
    color : "rgba(0, 0, 0, 1)",
    width : 2
    })
    })
    })
    },
    "GPX" : {
    defaultStyle : new ol.style.Style({
    image : new ol.style.Icon({
    src : "path/to/my/icon.png",
    size : [51, 38],
    }),
    stroke : new ol.style.Stroke({
    color : "#ffffff",
    width : 7
    })
    })
    }
    }
    });

Properties

_container: HTMLElement
_currentImportType: any
_currentStaticImportType: any
_defaultGeoJSONStyle: undefined | Style
_defaultGPXStyle: undefined | Style
_defaultKMLStyle: undefined | Style
_defaultMapBoxStyle: undefined | Style
_isCurrentImportTypeStatic: undefined | boolean
_uid: any
collapsed: undefined | boolean
contentService: any
description: any
disposed: boolean

The object has already been disposed.

draggable: undefined | boolean
element: HTMLElement
listable: boolean
listenerKeys: EventsKey[]
on: ObjectOnSignature<EventsKey>
once: ObjectOnSignature<EventsKey>
options:
    | undefined
    | {
        collapsed: boolean;
        draggable: boolean;
        layerTypes: string[];
        vectorStyleOptions: {
            GeoJSON: { defaultStyle: {} };
            GPX: { defaultStyle: {} };
            KML: {
                defaultStyle: {};
                extractStyles: boolean;
                showPointNames: boolean;
            };
            MapBox: { defaultStyle: {}; editor: {} };
        };
        webServicesOptions: {};
    }
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 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

  • 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