A Point represents a geographical point.
| Name | Type | Description |
|---|---|---|
lat |
H.geo.Latitude |
A value indicating latitude |
lng |
H.geo.Longitude |
A value indicating longitude |
opt_alt |
H.geo.Altitude |
optional
A value indicating altitude |
Examples
var geoPoint = new H.geo.Point(1, 51);
Full code example: Interactive map layer;
Full code example: Custom cluster theme;
Extends
Implements
Members
-
alt H.geo.Altitude | undefined
-
This property represents the altitude of the point.
-
lat H.geo.Latitude non-null
-
This property represents the latitude of the point.
-
lng H.geo.Longitude non-null
-
This property represents the longitude of the point.
Methods
-
H.geo.Point.fromIPoint (iPoint)H.geo.Point static
-
This method creates a
Pointinstance from anIPointobject.Name Type Description iPointH.geo.IPoint The
IPointobject to useReturns:
Type Description H.geo.Point The newly created Pointinstance -
Validates the given instance of
Point. It checks iflat,lng,althave valid types. Additionally, the method checks if the value of thelatproperty is in the range[-90 ... +90], the modulo of the value oflngin the range[-180 ... +180], and it validates thealtproperty.This:
Name Type Description pointH.geo.IPoint An object representing the point to validate
opt_callerfunction optional The caller to use to throw InvalidArgumentError, if omitted no error is thrown
opt_argNrnumber optional The argument number to use for InvalidArgumentError
Returns:
Type Description boolean trueif the given point is valid, otherwisefalse -
Returns the distance between the point and the point supplied by the caller. The method uses the Haversine formula. The altitude is not considered.
Name Type Description otherH.geo.IPoint An object representing the point to which to calculate the distance
Returns:
Type Description number A value indicating the distance between the given location and the location supplied by the caller in meters -
Checks whether the geometry is equal to the geometry supplied by the caller. Two geometries are considered as equal if they represent the same geometry type and have equal coordinate values.
Name Type Description other* The geometry to check against
Returns:
Type Description boolean trueif the two geometries are equal, otherwisefalse -
getBoundingBox ()H.geo.Rect inherited overrides
-
Returns the bounding rectangle of the geometry.
Returns:
Type Description H.geo.Rect -
toGeoJSON ()Object inherited
-
To obtain a GeoJSON representation of the given geometry.
Returns:
Type Description Object A GeoJSON Geometry object representing the given geometry. -
toString () inherited
-
To obtain a Well-Known-Text (WKT) representation of the geometry.
-
walk (bearing, distance, opt_overGreatCircle)H.geo.Point
-
Returns the destination point, based on the given distance and bearing relative to the current point. The algorithm is based on the Haversine formula. The altitude is ignored, instead the WGS84 Mean Radius is taken.
Name Type Description bearingnumber The bearing to the destination in degrees
distancenumber The distance to the destination in meters
opt_overGreatCircleboolean optional truemeans that the computation is to use the "Great Circle", otherwise it uses "Rhumb Line".Returns:
Type Description H.geo.Point An object representing the calculated point