Geoportal Extension for OpenLayers API Reference

Class: Export

ol.control.Export

Export button

new Export(options)

OpenLayers/Controls/Export.js, line 86
Name Type Description
options Object

options for function call.

Name Type Default Description
format String "geojson" optional

geojson / kml / gpx

name String "export" optional

export name

title String "Exporter" optional

button name

menu Boolean false optional

displays the format choice menu

onExport function optional

callback

target DOMElement optional

target

control Object

instance of control

Fires:
  • export:compute
Example
// pluggued widget Export into control Isocurve
var iso = new ol.control.Isocurve();
map.addControl(iso);

// method : call render()
var export = new ButtonExport();
export.setControl(iso);
export.setTarget();
export.setName("export");
export.setFormat("geojson");
export.setTitle("Exporter");
export.setMenu(false);
export.render(); // <-- direct call to render function !
export.on("export:compute", (data) => { console.log(data); });

// method : call map.addControl()
var export = new ButtonExport();
export.setControl(iso);
export.setTarget();
export.setName("export");
export.setFormat("geojson");
export.setTitle("Exporter");
export.setMenu(false);
export.on("export:compute", (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({
  control : iso,
  target : ,
  name : "export",
  format : "geojson",
  title : "Exporter",
  menu : false
});
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 : {
  name : "export",
  format : "geojson",
  title : "Exporter",
  menu : false
}});

Members

EXPORT_ISOCHRON

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

See:
Example
// 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)

See:
Example
// 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)

See:
Example
// GeoJSON format
{
  "type":"FeatureCollection",
  "features":[...],
  "geoportail:compute":{
    "points":[ [2.588024210134887, 48.84192678293002 ] ],
    "transport":"Voiture",
    "exclusions":[...],
    "computation":"fastest",
    "results":{  }
}

Methods

onClickButtonExport(e)

OpenLayers/Controls/Export.js, line 536

...

Name Type Description
e *

Click

render()

OpenLayers/Controls/Export.js, line 246

Render DOM

setControl(control)

OpenLayers/Controls/Export.js, line 598

...

Name Type Description
control Object

...

setFormat(format)

OpenLayers/Controls/Export.js, line 616

...

Name Type Description
format String

...

setMenu(active)

OpenLayers/Controls/Export.js, line 667

...

Name Type Description
active Boolean

...

setName(name)

OpenLayers/Controls/Export.js, line 645

...

Name Type Description
name String

...

setTarget(target)

OpenLayers/Controls/Export.js, line 607

...

Name Type Description
target DOMElement

...

setTitle(title)

OpenLayers/Controls/Export.js, line 654

...

Name Type Description
title String

...