new Drawing(options)
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | Object | 
                
                 options for function call. 
  | 
        
Example
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;
     }
});
    
    
Extends
- ol.control.Control
 
Members
- 
    
collapsed
 - 
    
    
{Boolean} specify if Drawing control is collapsed (true) or not (false)
 - 
    
draggable
 - 
    
    
{Boolean} specify if Drawing control is draggable (true) or not (false)
 
Methods
- 
    
exportFeatures(){String}
OpenLayers/Controls/Drawing.js, line 373 - 
    
    
    
Export features of current drawing layer (KML by default).
Returns:
representation of drawn features (KML, GPX or GeoJSON) or null if not possible.
 - 
    
getContainer(){DOMElement}
OpenLayers/Controls/Drawing.js, line 588 - 
    
    
    
Get container
 - 
    
getExportFormat(){String}
OpenLayers/Controls/Drawing.js, line 502 - 
    
    
    
getter for Export format.
Returns:
format
 - 
    
getExportName(){String}
OpenLayers/Controls/Drawing.js, line 466 - 
    
    
    
getter for Export Name.
Returns:
name
 - 
    
getLayer(){Object}
OpenLayers/Controls/Drawing.js, line 579 - 
    
    
    
Get vector layer
Returns:
- isocurve layer
 - 
    
setCollapsed(collapsed)
OpenLayers/Controls/Drawing.js, line 439 - 
    
    
    
Collapse or display control main container
Name Type Description collapsed Boolean True to collapse control, False to display it
 - 
    
setExportFormat(format)
OpenLayers/Controls/Drawing.js, line 475 - 
    
    
    
Setter for Export format (KML, GPX or GeoJSON).
Name Type Description format String Export format. By default, "KML".
 - 
    
setExportName(name)
OpenLayers/Controls/Drawing.js, line 457 - 
    
    
    
Setter for Export Name.
Name Type Description name String Export Name. By default, "Croquis".
 - 
    
setLayer(vlayer)
OpenLayers/Controls/Drawing.js, line 511 - 
    
    
    
Sets vector layer to hosts feature.
Name Type Description vlayer ol.layer.Vector vector layer
 - 
    
setMap(map)
OpenLayers/Controls/Drawing.js, line 321 - 
    
    
    
Overload of ol.control.Control.setMap() method, called when control is added to or removed from map.
Name Type Description map Object ol.Map object.
 
