A Geometry is a description of a geographic object.
NAME | DESCRIPTION |
---|---|
id | {String} A unique identifier for this geometry. |
parent | {ZOO.Geometry}This is set when a Geometry is added as component of another geometry |
bounds | {ZOO.Bounds} The bounds of this geometry |
NAME | DESCRIPTION |
---|---|
ZOO.Geometry | Creates a geometry object. |
destroy | nullify references to prevent circular references and memory leaks |
clone | Create a clone of this vector feature. |
extendBounds | Moves the feature and redraws it at its new location |
clearBounds | Nullify this components bounds and that of its parent as well. |
getBounds | Get the bounds for this Geometry. |
calculateBounds | Recalculate the bounds for the geometry. |
toString | Returns the Well-Known Text representation of a geometry |
ZOO.Geometry.fromWKT | Generate a geometry given a Well-Known Text string. |
Properties
Functions
destroy: function()
Destroy this geometry.
clone: function()
Create a clone of this geometry. Does not set any non-standard properties of the cloned geometry.
Returns
{ZOO.Geometry} An exact clone of this geometry.
extendBounds: function(newBounds)
Extend the existing bounds to include the new bounds. If geometry’s bounds is not yet set, then set a new Bounds.
Parameters
newBounds {ZOO.Bounds}
clearBounds: function()
Nullify this components bounds and that of its parent as well.
getBounds: function()
Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.
Returns
newBounds {ZOO.Bounds}
calculateBounds: function()
Recalculate the bounds for the geometry.
toString: function()
Returns the Well-Known Text representation of a geometry
Returns
{String} Well-Known Text
ZOO.Geometry.fromWKT = function(wkt)
Generate a geometry given a Well-Known Text string.
Parameters
wkt {String} A string representing the geometry in Well-Known Text.
Returns
{ZOO.Geometry} A geometry of the appropriate class.