geopf-extensions-openlayers
    Preparing search index...

    Class LayerImport

    Hierarchy (View Summary)

    Index
    • Parameters

      • options: {
            collapsed?: boolean;
            dragAndDropUI?: boolean;
            draggable?: boolean;
            id?: number;
            layerTypes?: any[];
            title?: string;
            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.

        • OptionaldragAndDropUI?: boolean

          Specify if the static import form is displayed with a drag and drop area (without name input nor local/url choice). Default is false.

        • 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.

        • Optionaltitle?: string

          Title of the widget panel

        • 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
      })
      })
      }
      }
      });
    _container: HTMLElement
    _currentImportType: any
    _currentStaticImportType: any
    _defaultGeoJSONStyle: Style | undefined
    _defaultGPXStyle: Style | undefined
    _defaultKMLStyle: Style | undefined
    _defaultMapBoxStyle: Style | undefined
    _isCurrentImportTypeStatic: boolean | undefined
    _uid: any
    collapsed: boolean | undefined
    contentService: any
    description: any
    disposed: boolean

    The object has already been disposed.

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

      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 Listener[] | undefined

      Listeners.

    • Get the map associated with this control.

      Returns Map | null

      Map.

    • Get an object of all property names and values.

      Returns NoInfer<{ [x: string]: any }>

      Object.

    • Get an object of all property names and values.

      Returns Partial<NoInfer<{ [x: string]: any }>> | null

      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: Partial<NoInfer<Properties>>

        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