Maps API for JavaScript Developer's Guide

H.geo.Point

Class Summary

Implements: H.geo.IPoint

Class represents a geographical point, which is defined by the latitude, longitude and optional altitude.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

lat : {H.geo.Latitude}

The latitude coordinate.

lng : {H.geo.Longitude}

The longitude coordinate.

alt : {H.geo.Altitude}

The altitude coordinate.

ctx : {H.geo.AltitudeContext}

The altitude context.

Method Summary

Table 2. Methods
Methods

equals (other) : {boolean}

To compare this point with a supplied other point for equality. Two points are considered equal if they have the same lat and lng as well as equivalent values for alt and ctx.

distance (other) : {number}

To calculate the distance between this point and the supplied other point. The method uses the Haversine formula. The altitude is not considered.

walk (bearing, distance, opt_overGreatCircle) : {H.geo.Point}

This method calculates the geographic point of a destination point using the distance and bearing specified by the caller. The altitude is ignored, instead the WGS84 Mean Radius is taken.

static validate (point, opt_caller, opt_argNr) : {boolean}

This method validates the given IPoint. It checks, if lat, lng, alt and ctx have valid types. Additionally the value of the lat property is clamped into a range of -90 ... +90 and the value of the lng property is modulo into a range of -180 ... +180 plus validates the values of the alt and ctx properties

static fromIPoint (iPoint) : {H.geo.Point}

This method creates a Point instance from a given IPoint object.

Class Description

Class represents a geographical point, which is defined by the latitude, longitude and optional altitude.

Example

var geoPoint = new H.geo.Point(1, 51);

Constructor Details

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

Parameters:
 
lat:
{H.geo.Latitude}
 
The latitude coordinate
lng:
{H.geo.Longitude}
 
The longitude coordinate
opt_alt:
{H.geo.Altitude=} [optional]
 
The altitude coordinate
opt_ctx:
{H.geo.AltitudeContext=} [optional]
 
The altitude context

Property Details

lat: {H.geo.Latitude}

The latitude coordinate.

lng: {H.geo.Longitude}

The longitude coordinate.

alt: {H.geo.Altitude}

The altitude coordinate.

ctx: {H.geo.AltitudeContext}

The altitude context.

Method Details

equals (other) : {boolean}

To compare this point with a supplied other point for equality. Two points are considered equal if they have the same lat and lng as well as equivalent values for alt and ctx.

Parameters:
 
other:
{H.geo.IPoint}
 
Returns:
 
{boolean}
Whether the two points are equal.

distance (other) : {number}

To calculate the distance between this point and the supplied other point. The method uses the Haversine formula. The altitude is not considered.

Parameters:
 
other:
{H.geo.IPoint}
 
Returns:
 
{number}
The distance between the given location and the location supplied by the caller in meters

walk (bearing, distance, opt_overGreatCircle) : {H.geo.Point}

This method calculates the geographic point of a destination point using the distance and bearing specified by the caller. The altitude is ignored, instead the WGS84 Mean Radius is taken.

Parameters:
 
bearing:
{number}
 
The bearing to use in the calculation in degrees
distance:
{number}
 
The distance to the destination in meters
opt_overGreatCircle:
{boolean=} [optional]
 
If true the computation uses the "Great Circle" otherwise "Rhumb Line".
Returns:
 
{H.geo.Point}
The calculated point

static validate (point, opt_caller, opt_argNr) : {boolean}

This method validates the given IPoint. It checks, if lat, lng, alt and ctx have valid types. Additionally the value of the lat property is clamped into a range of -90 ... +90 and the value of the lng property is modulo into a range of -180 ... +180 plus validates the values of the alt and ctx properties

Parameters:
 
point:
{H.geo.IPoint}
 
The point to validate
opt_caller:
{Function=} [optional]
 
The caller to use for InvalidArgumentError. If omitted no error is thrown
opt_argNr:
{number=} [optional]
 
The argument number to use for InvalidArgumentError.
Returns:
 
{boolean}
if the given point could validate

static fromIPoint (iPoint) : {H.geo.Point}

This method creates a Point instance from a given IPoint object.

Parameters:
 
iPoint:
{H.geo.IPoint}
 
The IPoint object to use
Returns:
 
{H.geo.Point}
the created Point instance

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.