geopf-extensions-openlayers
    Preparing search index...

    Class ButtonExport

    Hierarchy

    • Control
      • ButtonExport
    Index
    • Parameters

      • options: {
            callback?: Function;
            control?: any;
            description?: string;
            direction?: string;
            download?: string;
            format?: string;
            icons?: { button?: string; menu?: string };
            id?: number;
            kind?: string;
            layer?: any;
            menu?: boolean;
            menuOptions?: {
                above?: boolean;
                labelDesc?: boolean;
                labelName?: boolean;
                outside?: boolean;
                selectFormat?: boolean;
            };
            name?: string;
            target?: HTMLElement;
            title?: string;
        }

        options for function call.

        • Optionalcallback?: Function

          with a callback, the implementation is your responsibility

        • Optionalcontrol?: any

          instance of control

        • Optionaldescription?: string

          export description put into file

        • Optionaldirection?: string

          buttons and menus layout

        • Optionaldownload?: string

          triggering the download of the file

        • Optionalformat?: string

          geojson / kml / gpx

        • Optionalicons?: { button?: string; menu?: string }

          icons

          • Optionalbutton?: string

            displays the button icon : save or export icon, or otherwise left blank if you don't want it

          • Optionalmenu?: string

            displays the menu icon, or otherwise left blank if you don't want it

        • Optionalid?: number

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

        • Optionalkind?: string

          button type : primary | secondary | tertiary

        • Optionallayer?: any

          the layer instance is retrieved from the control, but you can defined it

        • Optionalmenu?: boolean

          displays the menu

        • OptionalmenuOptions?: {
              above?: boolean;
              labelDesc?: boolean;
              labelName?: boolean;
              outside?: boolean;
              selectFormat?: boolean;
          }

          options of the menu.

          • Optionalabove?: boolean

            displays menu above or not of the button

          • OptionallabelDesc?: boolean

            displays the label description

          • OptionallabelName?: boolean

            displays the label name

          • Optionaloutside?: boolean

            displays all element outside of menu

          • OptionalselectFormat?: boolean

            displays the select format

        • Optionalname?: string

          export name file

        • Optionaltarget?: HTMLElement

          target where the button will plug in. By default, the target is 'container-buttons-plugin' into the wikdget

        • Optionaltitle?: string

          button name

      Returns ButtonExport

      button:clicked

      // pluggued widget Export into control Isocurve
      var iso = new ol.control.Isocurve();
      map.addControl(iso);

      // method : call render()
      var export = new ButtonExport();
      export.setDownload(true);
      export.setControl(iso);
      export.setTarget(<!-- HTMLElement -->);
      export.setName("export");
      export.setFormat("geojson");
      export.setDescription("Export Isochrone");
      export.setTitle("Exporter");
      export.setMenu(true);
      export.setMenuOptions({
      outside : false,
      labelName : true,
      labelDesc : true,
      selectFormat : true
      });
      export.render(); // <-- direct call to render function !
      export.on("button:clicked", (data) => { console.log(data); });

      // method : call map.addControl()
      var export = new ButtonExport();
      export.setDownload(true);
      export.setControl(iso);
      export.setTarget(<!-- HTMLElement -->);
      export.setName("export");
      export.setFormat("geojson");
      export.setDescription("Export Isochrone");
      export.setTitle("Exporter");
      export.setKind("secondary");
      export.setMenu(false);
      export.on("button:clicked", (data) => { console.log(data); });
      map.addControl(export); // <-- using the OpenLayers mechanism, don't call to render function !

      // use control options instead of setters
      var export = new ButtonExport({
      download : true,
      control : iso,
      target : <!-- HTMLElement -->,
      name : "export",
      description : "Export Isochrone",
      format : "geojson",
      title : "Exporter",
      menu : false,
      callback : (content, layer) => {
      console.log(content, layer);
      }
      });
      map.addControl(export);

      // method with passing option into the control Isocurve
      var iso = new ol.control.Isocurve({ export : true });
      // with control options :
      var iso = new ol.control.Isocurve({ export : {
      download : false,
      name : "save-iso",
      format : "geojson",
      title : "Sauvegarde",
      menu : true
      }});
    disposed: boolean

    The object has already been disposed.

    element: HTMLElement | null
    EXPORT_ISOCHRON: {}

    Response to the export of the isochron calculation (only for jsdoc)

    // GeoJSON format
    {
    "type":"FeatureCollection",
    "features":[...],
    "geoportail:compute":{
    "transport":"Pieton",
    "computation":"time",
    "exclusions":[

    ],
    "direction":"departure",
    "point":[ 2.587835382718464, 48.84192678293002 ],
    "results":{
    "message":"",
    "id":"",
    "location":{
    "x":"2.587835382718464",
    "y":"48.84192678293002"
    },
    "srs":"EPSG:4326",
    "geometry":{
    "type":"Polygon",
    "coordinates":[[...]]
    },
    "time":180,
    "distance":""
    }
    }
    }
    EXPORT_PROFILE: {}

    Response to the export of the profile calculation (only for jsdoc)

    // GeoJSON format
    {
    "type":"FeatureCollection",
    "features":[...],
    "geoportail:compute":{
    "greaterSlope":76,
    "meanSlope":7,
    "distancePlus":84,
    "distanceMinus":48,
    "ascendingElevation":5,
    "descendingElevation":-4,
    "altMin":"92,04",
    "altMax":"96,71",
    "distance":163,
    "unit":"m",
    "points":[
    {
    "z":95.68,
    "lon":2.5874,
    "lat":48.8419,
    "acc":2.5,
    "dist":0,
    "slope":0
    }
    ]
    }
    }
    EXPORT_ROUTE: {}

    Response to the export of the route calculation (only for jsdoc)

    // GeoJSON format
    {
    "type":"FeatureCollection",
    "features":[...],
    "geoportail:compute":{
    "points":[ [2.588024210134887, 48.84192678293002 ] ],
    "transport":"Voiture",
    "exclusions":[...],
    "computation":"fastest",
    "results":{ <!-- Service --> }
    }
    listenerKeys: EventsKey[]
    on: ObjectOnSignature<EventsKey>
    once: ObjectOnSignature<EventsKey>
    options:
        | {
            callback: null;
            control: null;
            description: string;
            direction: string;
            download: boolean;
            format: string;
            icons: { button: string; menu: string };
            kind: string;
            layer: null;
            menu: boolean;
            menuOptions: {
                above: boolean;
                labelDesc: boolean;
                labelName: boolean;
                outside: boolean;
                selectFormat: boolean;
            };
            name: string;
            target: null;
            title: string;
        }
        | undefined
    uid: number
    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

    • Sets a value.

      Parameters

      • key: string

        Key name.

      • value: any

        Value.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Remove the control from its current map and attach it to the new map. Pass null to just remove the control from the current map. Subclasses may set up event handlers to get notified about changes to the map here.

      Parameters

      • map: Map | null

        Map.

      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

    • 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

    BUTTON_EXPORT_CLICKED_EVENT: string

    event triggered when the export is finished

    button:clicked

    "button:clicked"
    
    Export.on("button:clicked", function (e) {
    console.log(e.target);
    })