Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Geo locations in Navmii SDK are represented as instances of the read-only MapCoordinates class. It has two three methods: getLatitude (returns values in the range [-90, 90]) and , getLongitude (returns values in the range [-180, 180)) and getDistanceTo.

getDistanceTo calculates the distance between the current point and a specified point, returning the result in meters. This method computes the geographical distance using the latitude and longitude values provided in the MapCoordinates object.

Example:


Code Block
languagejava
// New York City coordinates
MapCoordinates destination = new MapCoordinates(40.7128, -74.0060);
double distance = currentLocation.getDistanceTo(destination);
System.out.println("Distance: " + distance + " meters"); 

Navmii SDK also has the MapRectangle class representing a rectangle area on the map. It can be created by specifying its top left and bottom right corners.

...