Optional
collapsed?: booleanSpecify if Drawing control should be collapsed at startup. Default is true.
Optional
draggable?: booleanSpecify if widget is draggable
Optional
id?: numberAbility to add an identifier on the widget (advanced option)
Optional
labels?: stringLabels for Control
Optional
layer?: anyOpenlayers layer that will hosts created features. If none, an empty vector layer will be created.
Optional
layerDescription?: { description?: string; title?: string }Layer informations to be displayed in LayerSwitcher widget (only if a LayerSwitcher is also added to the map)
Optional
description?: stringLayer description to be displayed in LayerSwitcher
Optional
title?: stringLayer title to be displayed in LayerSwitcher
Optional
popup?: { display?: boolean; function?: Function }Popup informations
Optional
display?: booleanSpecify if popup is displayed when create a drawing
Optional
function?: FunctionFunction to display popup informations if you want to cutomise it. You may also provide your own function with params : {geomType / feature / saveFunc(message) / closeFunc()}. This function must return the DOM object of the popup content.
Tools to display in the drawing toolbox. All by default.
Optional
display?: booleanDisplay style editing tool
Optional
edit?: booleanDisplay editing tool
Optional
export?: booleanDisplay exporting tool
Optional
holes?: booleanDisplay polygons with holes drawing tool
Optional
lines?: booleanDisplay lines drawing tool
Optional
measure?: booleanDisplay measure drawing into popup info
Optional
points?: booleanDisplay points drawing tool
Optional
polygons?: booleanDisplay polygons drawing tool
Optional
remove?: booleanDisplay feature removing tool
Optional
text?: booleanDisplay text drawing tool
Optional
tooltip?: booleanDisplay text editing tool
var drawing = new ol.control.Drawing({
collapsed : false,
draggable : true,
layerswitcher : {
title : "Dessins",
description : "Mes dessins..."
},
markersList : [{
src : "http://api.ign.fr/api/images/api/markers/marker_01.png",
anchor : [0.5, 1]
}],
defaultStyles : {},
cursorStyle : {},
tools : {
points : true,
lines : true,
polygons :true,
holes : true,
text : false,
remove : true,
display : true,
tooltip : true,
export : true,
measure : true
},
popup : {
display : true,
function : function (params) {
var container = document.createElement("div");
// - params.geomType;
// - params.feature;
// Les 2 fonctions ferment la popup avec ou sans sauvegarde des informations
// dans les properties de la feature (key : description)
// - params.saveFunc(message);
// - params.closeFunc();
return container;
}
});
Protected
disposedThe object has already been disposed.
Protected
listenerKey name.
Listener.
Type.
Listener.
Protected
applyProtected
Apply any properties from another object without triggering events.
The source object.
Disable interaction
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.
Protected
disposeProtected
Extension point for disposable objects.
Export features of current drawing layer (KML by default).
a representation of drawn features (KML, GPX or GeoJSON) or null if not possible.
Get container
container
getter for Export format.
export format
getter for Export Name.
export name
Get vector layer
layer - isocurve layer
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.
Optional
type: 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.
Protected
onceProtected
onKey name.
Listener.
Type.
Listener.
Collapse or display control main container
True to collapse control, False to display it
Setter for Export format (KML, GPX or GeoJSON).
Export format. By default, "KML".
Setter for Export Name.
Export Name. By default, "Croquis".
Sets vector layer to hosts feature.
vector layer
Overload of ol.control.Control.setMap() method, called when control is added to or removed from map.
ol.Map object.
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.
Target.
Protected
unProtected
Unlisten for a certain type of event.
Type.
Listener.
options for function call.