Class: Point

H.geo.Point

new H.geo.Point (lat, lng, opt_alt)

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 Point instance from an IPoint object.

Name Type Description
iPoint H.geo.IPoint

The IPoint object to use

Returns:
Type Description
H.geo.Point The newly created Point instance

H.geo.Point.validate (point, opt_caller, opt_argNr)boolean static

Validates the given instance of Point. It checks if lat, lng, alt have valid types. Additionally, the method checks if the value of the lat property is in the range [-90 ... +90], the modulo of the value of lng in the range [-180 ... +180], and it validates the alt property.

This:
Name Type Description
point H.geo.IPoint

An object representing the point to validate

opt_caller function optional

The caller to use to throw InvalidArgumentError, if omitted no error is thrown

opt_argNr number optional

The argument number to use for InvalidArgumentError

Returns:
Type Description
boolean true if the given point is valid, otherwise false

distance (other)number

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

equals (other)boolean inherited overrides

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, otherwise false

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
bearing number

The bearing to the destination in degrees

distance number

The distance to the destination in meters

opt_overGreatCircle boolean optional

true means 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