Class: Point
- Last UpdatedMay 21, 2025
- 2 minute read
A Point represents a geographical point.
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
Point
instance from anIPoint
object.Name Type Description iPoint
H.geo.IPoint The
IPoint
object to useReturns:
Type Description H.geo.Point The newly created Point
instance -
Validates the given instance of
Point
. It checks iflat
,lng
,alt
have valid types. Additionally, the method checks if the value of thelat
property is in the range[-90 ... +90]
, the modulo of the value oflng
in the range[-180 ... +180]
, and it validates thealt
property.This:
Returns:
Type Description boolean true
if 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 other
H.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 true
if 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.
Returns:
Type Description H.geo.Point An object representing the calculated point