Class GSPolygonDrawingHandler

Extends GSDrawingHandler.

A helper class for drawing polygon shapes.

Class Summary
Constructor Attributes Constructor Name and Description
 
GSPolygonDrawingHandler(layer, options)
Constructs a new GSPolygonDrawingHandler that is initialized with the properties provided.
Methods borrowed from class GSDrawingHandler:
cancelDrawing, snapPoint, startDrawing, stopDrawing
Class Detail
GSPolygonDrawingHandler(layer, options)
Constructs a new GSPolygonDrawingHandler that is initialized with the properties provided. This class should not be instantiated directly, but instead referenced by GSPolygon.drawingHandler.


var drawStyle = {stroke: '#a80510', 'stroke-width': '2px', 'stroke-opacity': 0.8,  fill: '#a80510', 'fill-opacity': 0.4 };
var viewStyle = {stroke: '#3886d9', 'stroke-width': '2px', 'stroke-opacity': 0.8, fill: '#3886d9', 'fill-opacity': 0.3};
var options = {
    drawStyle:  drawStyle,
    viewStyle:  viewStyle,
    onShapeCreated: function(shape) {
        console.log(shape);
    }
};
var drawingHandler = new GSPolygonDrawingHandler(map.getLayer('base'), options);
Parameters:
{GSLayer} layer
the layer object that this drawing handler will create features on
{Object} options Optional
an object literal specifying the options to set:
{Object} options.drawStyle
object literal specifying the style properties to use while drawing the shape
{Object} options.featureOptions
options to set on new features created by the drawing handler. Any valid option supported by the feature type to be drawn
{Function} options.onShapeCreated
callback function that is invoked when drawing has finished and the shape is created. Receives the newly created shape as an argument.
{Function} options.onDrawingCancelled
callback function that is invoked when a drawing is cancelled, no shape is created.

Documentation generated by JsDoc Toolkit 2.3.2 on Wed Mar 07 2012 11:47:29 GMT+1300 (NZDT)