New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see
New map style for Google Maps Platform.
GoogleMaps Framework Reference
GMSGeometryContainsLocation
extern BOOL GMSGeometryContainsLocation(CLLocationCoordinate2D point,
GMSPath *_Nonnull path, BOOL geodesic)
Returns whether point
lies inside of path. The path is always considered closed, regardless of
whether the last point equals the first or not.
Inside is defined as not containing the South Pole – the South Pole is always outside.
path
describes great circle segments if geodesic
is YES, and rhumb (loxodromic) segments
otherwise.
If point
is exactly equal to one of the vertices, the result is YES. A point that is not equal
to a vertex is on one side or the other of any path segment – it can never be “exactly on the
border”.
See GMSGeometryIsLocationOnPath()
for a border test with tolerance.
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 2024-11-15 UTC.
[null,null,["Last updated 2024-11-15 UTC."],[[["Determines if a given geographical point (latitude/longitude) lies within a specified path on the Earth's surface."],["Considers the path closed, irrespective of its last point's connection to the first, and always excludes the South Pole as being outside the path."],["Defines the path's segments as great circles for geodesic calculations or rhumb lines for non-geodesic ones."],["Returns true if the point exactly matches a path vertex; otherwise, the point is considered strictly inside or outside the path, not on the border."],["For border proximity checks with a tolerance, refer to the separate function `GMSGeometryIsLocationOnPath()`."]]],[]]