# WPS.Control.GeometryEditor

The Geometry editor gives access to the legato map client. It is possible to create and edit geometrys using JS code.

Inherits from: | <WPS.Contro>

Summary

WPS.Control.GeometryEditor | The Geometry editor gives access to the legato map client.
Functions |
initialize | Basic constructor
destroy | <OpenLayer.Control>
draw | <OpenLayer.Control>
resets the Geometry Editor and clears the editor form |
createGeometry | Shows a Form in configured div and enables the user to paint a geometry based on given process settings.
createGeometry | Shows a Form in configured div and enables the user to edit the given geometry.
lwpsc:GeometryEditor | XML based config for a WPS.Control.GeometryEditor.

### Functions

### initialize

> initialize : function( | options | )

Basic constructor

#### Parameters

options | {Object} A Hashmap containing option parameters for this control The following keys are supported

- map {<OpenLayers.Map>} The current map

### destroy

> destroy : function()

#### See Also

<OpenLayer.Control>

### draw

> draw: function ()

#### See Also

<OpenLayer.Control>

### resets the Geometry Editor and clears the editor form

### createGeometry

> createGeometry: function( | processDesc,
> | paramDesc,
> | onExecute,
> | onCancel | )

Shows a Form in configured div and enables the user to paint a geometry based on given process settings.

#### Parameters

processDesc | {Object} A Hashmap containing the description for the process The following keys are supported

- id {String} The id for this process
- title {String} A title describing this process
- description {String} A detailed description for this process

paramDesc | {Object} A Hashmap containing the description for the process parameter The following keys are supported

- id {String} The id for this process
- title {String} A title describing this process
- description {String} A detailed description for this process
- type {String} The geometry type which will been painted by the user (e.g. Point, Polygon, etc)

onExecute | {Function} A callback method which will been executed after the user has finished the procress. If this callback returns true the editor resets itself automatically.
onCancel | {Function} A callback method which will been executed if the user has canceled this process. If this callback returns true the editor resets itself automatically.

### createGeometry

Shows a Form in configured div and enables the user to edit the given geometry.

#### Parameters

processDesc | {Object} A Hashmap containing the description for the process The following keys are supported

- id {String} The id for this process
- title {String} A title describing this process
- description {String} A detailed description for this process

paramDesc | {Object} A Hashmap containing the description for the process parameter The following keys are supported

- id {String} The id for this process
- title {String} A title describing this process
- description {String} A detailed description for this process
- geometry {JSON} A GEO JSON Object representing the geometry for editing

onExecute | {Function} A callback method which will been executed after the user has finished the procress. If this callback returns true the editor resets itself automatically.
onCancel | {Function} A callback method which will been executed if the user has canceled this process. If this callback returns true the editor resets itself automatically.

## lwpsc:GeometryEditor

XML based config for a WPS.Control.GeometryEditor.

#### See Also

- <Legato.Control>
- <Legato.Beans.BeanFactory>
- <QName>

#### A valid config example for a GeometryEditor would be

>     <lwpsc:GeometryEditor id="geometryEditor" div="geometryEditor">
>       <map>
>         <lb:Reference target="map" />
>       </map>
>     </lwpsc:GeometryEditor>

> initialize : function( | options | )

Basic constructor

> destroy : function()

OpenLayer.Control

> draw: function ()

OpenLayer.Control

> createGeometry: function( | processDesc,
> | paramDesc,
> | onExecute,
> | onCancel | )

Shows a Form in configured div and enables the user to paint a geometry based on given process settings.
The Geometry editor gives access to the legato map client.