Class eniro.maps.Coordinate
Extends
eniro.maps.Point.
Defined in: Coordinate.js.
Constructor Attributes | Constructor Name and Description |
---|---|
eniro.maps.Coordinate(x, y, srs)
A (typed) coordinate which is a variant of point.
|
Method Attributes | Method Name and Description |
---|---|
approxEquals(other, tol)
Compare this coordinate with the given one and tell if they are
approximately equal using an optional tolerance.
|
|
equals(other)
Compare this instance with another instance.
|
|
getSrs()
Returns she spatial reference system.
|
|
transform(srs)
Transforms this coordinate to the spatial reference system given.
|
- Methods borrowed from class eniro.maps.Point:
- getX, getY
Class Detail
eniro.maps.Coordinate(x, y, srs)
A (typed) coordinate which is a variant of point. The type is the spatial
reference system used.
Class is considered a value type.
- Parameters:
- {number} x
- The x (east-west) value.
- {number} y
- The y (north-south) value.
- {eniro.maps.Srs} srs
- The spatial reference system.
Method Detail
approxEquals(other, tol)
Compare this coordinate with the given one and tell if they are
approximately equal using an optional tolerance. If the tolerance isn't
specified it defaults to 5 meters.
- Parameters:
- {eniro.maps.Coordinate} other
- The coordinate to compare to.
- {number} tol Optional, Default: 5
- The approximation tolerance in meters.
- Returns:
- true if this coordinate roughly equals the given one within the tolerance.
{boolean}
equals(other)
Compare this instance with another instance.
- Parameters:
- {eniro.maps.Coordinate} other
- The instance to compare this instance to.
- Returns:
- {boolean} true If this instance is equal to the given one.
{eniro.maps.Srs}
getSrs()
Returns she spatial reference system.
- Returns:
- {eniro.maps.Srs} The spatial reference system.
{eniro.maps.Coordinate}
transform(srs)
Transforms this coordinate to the spatial reference system given.
- Parameters:
- {eniro.maps.Srs} srs
- The target srs to transform to.
- Returns:
- {eniro.maps.Coordinate} If srs differ, a new Coordinate otherwise this.