Optionalcallback?: Functionwith a callback, the implementation is your responsibility
Optionalcontrol?: anyinstance of control
Optionaldescription?: stringexport description put into file
Optionaldirection?: stringbuttons and menus layout
Optionaldownload?: stringtriggering the download of the file
Optionalformat?: stringgeojson / kml / gpx
Optionalicons?: { button?: string; menu?: string }icons
Optionalbutton?: stringdisplays the button icon : save or export icon, or otherwise left blank if you don't want it
Optionalmenu?: stringdisplays the menu icon, or otherwise left blank if you don't want it
Optionalid?: numberAbility to add an identifier on the widget (advanced option)
Optionalkind?: stringbutton type : primary | secondary | tertiary
Optionallayer?: anythe layer instance is retrieved from the control, but you can defined it
Optionalmenu?: booleandisplays the menu
OptionalmenuOptions?: {options of the menu.
Optionalabove?: booleandisplays menu above or not of the button
OptionallabelDesc?: booleandisplays the label description
OptionallabelName?: booleandisplays the label name
Optionaloutside?: booleandisplays all element outside of menu
OptionalselectFormat?: booleandisplays the select format
Optionalname?: stringexport name file
Optionaltarget?: HTMLElementtarget where the button will plug in. By default, the target is 'container-buttons-plugin' into the wikdget
Optionaltitle?: stringbutton name
// 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
}});
ProtecteddisposedThe object has already been disposed.
ProtectedelementResponse 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":""
}
}
}
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
}
]
}
}
Response to the export of the route calculation (only for jsdoc)
ProtectedlistenerKey name.
Listener.
Type.
Listener.
ProtectedapplyProtectedApply any properties from another object without triggering events.
The source object.
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.
Event object.
false if anyone called preventDefault on the
event object or if any of the listeners returned false.
Clean up.
ProtecteddisposeProtectedExtension point for disposable objects.
Get container
container
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Get an object of all property names and values.
Object.
Optionaltype: stringType. If not provided,
true will be returned if this event target has any listeners.
Has listeners.
The object has properties.
Key name.
Old value.
ProtectedonceProtectedonKey name.
Listener.
Type.
Listener.
Render DOM
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
ProtectedunProtectedUnlisten for a certain type of event.
Type.
Listener.
options for function call.