dojox/geo/openlayers/GeometryFeature (version 1.10)

dojox/geo/openlayers/Feature

Summary

A Feature encapsulating a geometry.

This Feature renders a geometry such as a Point or LineString geometry. This Feature is responsible for reprojecting the geometry before creating a gfx shape to display it. By default the shape created is a circle for a Point geometry and a polyline for a LineString geometry. User can change these behavior by overriding the createShape method to create the desired shape.

Usage

var foo = new GeometryFeature(geometry);
dojox/geo/openlayers/GeometryFeature
Parameter Type Description
geometry dojox/geo/openlayers/Geometry

The geometry to render.

See the dojox/geo/openlayers/GeometryFeature reference documentation for more information.

Examples

Example 1

var geom = new dojox.geo.openlayers.Point({x:0, y:0});
var gf = new dojox.geo.openlayers.GeometryFeature(geom);

Property Summary

Method Summary

Properties

_defaults

Methods

_applyRecusiveStyle(g,stroke,fill)

Apply the style on the geometry's shape recursively.

Parameter Type Description
g dojox/geo/openlayers/Geometry

The geometry.

stroke Object

The stroke

fill Object

The fill

_applyStyle(g)

Apply the style on the geometry's shape.

Parameter Type Description
g Geometry

The geometry.

_createCollection(g)

Create collection shape and add it to the viewport.

Parameter Type Description
g dojox/geo/openlayers/Geometry
Returns:undefined
_createLineString(g)

Create polyline shape and add it to the viewport.

Parameter Type Description
g dojox/geo/openlayers/Geometry
Returns:undefined
_createPoint(g)

Create a point shape

Parameter Type Description
g dojox/geo/openlayer/Geometry
Returns:undefined
_getCollectionShape(g)

Get the collection shape, create it if necessary

Parameter Type Description
g dojox/geo/openlayers/Geometry
Returns:undefined
_getLineStringShape(g)

Get the line string geometry shape, create it if necessary

Parameter Type Description
g dojox/geo/openlayers/Geometry
Returns:undefined
_getLocalXY(p)

From projected coordinates to screen coordinates

Parameter Type Description
p Object

Object with x and y fields

Returns:Array
_getPointShape(g)

get the point geometry shape, create it if necessary

Parameter Type Description
g dojox/geo/openlayers/Geometry
Returns:undefined
_setLayer(l)

Sets the layer to which this Feature belongs

Called when the feature is added to the Layer.

Parameter Type Description
l dojox/geo/openlayers/Layer
createShape(s,g)

Called when the shape rendering the geometry has to be created. This default implementation creates a circle for a point geometry, a polyline for a LineString geometry and is recursively called when creating a collection. User may replace this method to produce a custom shape.

Parameter Type Description
s dojox/gfx/Surface

The surface on which the method create the shapes.

g dojox/geo/openlayers/Geometry
Optional

The reference geometry

Returns:any | undefined

The resulting shape.

getCoordinateSystem()

Returns the coordinate system in which coordinates of this feature are expressed.

Returns:any | undefined

The coordinate system in which coordinates of this feature are expressed.

getFill()

Returns the fill style

Returns:any | undefined

The fill style

getLayer()

Returns the Layer to which this feature belongs.

Returns:any | undefined

The layer to which this feature belongs.

getShape()

Returns the shape rendering the geometry

Returns:any | null | undefined

The shape used to render the geometry.

getShapeProperties()

Returns the shape properties.

Returns:Object | undefined

The shape properties.

getStroke()

Returns the stroke style

Returns:any | undefined

The stroke style

remove()

Removes the shape from the Surface. Called when the feature is removed from the layer.

render(g)

Render a geometry. Called by the Layer on which the feature is added.

Parameter Type Description
g dojox/geo/openlayer/Geometry
Optional

The geometry to draw

renderCollection(g)

Renders a geometry collection.

Parameter Type Description
g dojox/geo/openlayers/Geometry
Optional

The geometry to render.

renderLineString(g)

Renders a line string geometry.

Parameter Type Description
g dojox/geo/openlayers/Geometry
Optional

The geometry to render.

renderPoint(g)

Renders a point geometry.

Parameter Type Description
g dojox/geo/openlayers/Point
Optional

The geometry to render, or the current instance geometry if not specified.

setCoordinateSystem(cs)

Set the coordinate system in which coordinates of this feature are expressed.

Parameter Type Description
cs OpenLayers.Projection

The coordinate system in which coordinates of this feature are expressed.

setFill(f)

Set the fill style to be applied on the rendered shape.

Parameter Type Description
f Object

The fill style

Returns:function

Set the fill style to be applied on the rendered shape.

setShapeProperties(s)

Sets the shape properties.

Parameter Type Description
s Object

The shape properties to set.

Returns:function

Sets the shape properties.

setStroke(s)

Set the stroke style to be applied on the rendered shape.

Parameter Type Description
s Object

The stroke style

Returns:function

Set the stroke style to be applied on the rendered shape.

Error in the documentation? Can’t find what you are looking for? Let us know!