GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSMapPointDistance
Returns the length of the segment [a, b] in projected space.
The length is computed along the short path between the points potentially crossing the date
line. E.g. the distance between the points corresponding to San Francisco and Tokyo measures the
segment that passes north of Hawaii crossing the date line.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSMapPointDistance\u003c/code\u003e calculates the distance between two \u003ccode\u003eGMSMapPoints\u003c/code\u003e in projected space.\u003c/p\u003e\n"],["\u003cp\u003eThe calculated distance represents the shortest path between the points, even if it crosses the international date line.\u003c/p\u003e\n"],["\u003cp\u003eFor example, the distance between San Francisco and Tokyo is measured along the segment crossing the Pacific Ocean north of Hawaii.\u003c/p\u003e\n"]]],["The `GMSMapPointDistance` function calculates the distance between two `GMSMapPoint`s (a and b) in projected space. It determines the length of the shortest path between the points, even if this path crosses the international date line. The calculation considers the most direct route, exemplified by the distance between San Francisco and Tokyo being measured across the path north of Hawaii.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSMapPointDistance\n===================\n\n extern double GMSMapPointDistance(../Structs/GMSMapPoint.html a, ../Structs/GMSMapPoint.html b)\n\nReturns the length of the segment \\[a, b\\] in projected space.\n\nThe length is computed along the short path between the points potentially crossing the date\nline. E.g. the distance between the points corresponding to San Francisco and Tokyo measures the\nsegment that passes north of Hawaii crossing the date line."]]