Stay organized with collections Save and categorize content based on your preferences.
GMSProjection@interface GMSProjection : NSObject
Defines a mapping between Earth coordinates CLLocationCoordinate2D
and coordinates in the map’s view CGPoint
. A projection is constant and immutable, in that the mapping it embodies never changes. The mapping is not necessarily linear.
Passing invalid Earth coordinates (i.e., per CLLocationCoordinate2DIsValid
) to this object may result in undefined behavior.
This class should not be instantiated directly unless under testing conditions. Instead, obtain it via projection on GMSMapView
.
Maps an Earth coordinate to a point coordinate in the map’s view.
DeclarationSwift
func point(for coordinate: CLLocationCoordinate2D) -> CGPoint
Objective-C
- (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;
Maps a point coordinate in the map’s view to an Earth coordinate.
DeclarationSwift
func coordinate(for point: CGPoint) -> CLLocationCoordinate2D
Objective-C
- (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point;
Converts a distance in meters to content size. This is only accurate for small Earth distances, as it uses CGFloat
for screen distances.
Swift
func points(forMeters meters: CLLocationDistance, at coordinate: CLLocationCoordinate2D) -> CGFloat
Objective-C
- (CGFloat)pointsForMeters:(CLLocationDistance)meters
atCoordinate:(CLLocationCoordinate2D)coordinate;
Returns whether a given coordinate (lat/lng) is contained within the projection.
DeclarationSwift
func contains(_ coordinate: CLLocationCoordinate2D) -> Bool
Objective-C
- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate;
Returns the region (four location coordinates) that is visible according to the projection. If padding was set on GMSMapView
, this region takes the padding into account.
The visible region can be non-rectangular. The result is undefined if the projection includes points that do not map to anywhere on the map (e.g., camera sees outer space).
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-15 UTC."],[[["`GMSProjection` defines a mapping between Earth coordinates (`CLLocationCoordinate2D`) and coordinates in the map's view (`CGPoint`)."],["It provides methods to convert between Earth coordinates and point coordinates in the map's view."],["`GMSProjection` can also convert distances in meters to content size and determine if a coordinate is within the projection."],["You can obtain the visible region of the map using the `visibleRegion` method."],["This class should not be directly instantiated but obtained from a `GMSMapView` instance."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4