Stay organized with collections Save and categorize content based on your preferences.
GMSProjection
@interfaceGMSProjection: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.
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).
[[["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."],[[["\u003cp\u003e\u003ccode\u003eGMSProjection\u003c/code\u003e defines a mapping between Earth coordinates (\u003ccode\u003eCLLocationCoordinate2D\u003c/code\u003e) and coordinates in the map's view (\u003ccode\u003eCGPoint\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to convert between Earth coordinates and point coordinates in the map's view.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSProjection\u003c/code\u003e can also convert distances in meters to content size and determine if a coordinate is within the projection.\u003c/p\u003e\n"],["\u003cp\u003eYou can obtain the visible region of the map using the \u003ccode\u003evisibleRegion\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThis class should not be directly instantiated but obtained from a \u003ccode\u003eGMSMapView\u003c/code\u003e instance.\u003c/p\u003e\n"]]],[],null,["GMSProjection \n\n @interface GMSProjection : NSObject\n\nDefines a mapping between Earth coordinates `CLLocationCoordinate2D` and coordinates in the map's\nview `CGPoint`. A projection is constant and immutable, in that the mapping it embodies never\nchanges. The mapping is not necessarily linear.\n\nPassing invalid Earth coordinates (i.e., per `CLLocationCoordinate2DIsValid`) to this object may\nresult in undefined behavior.\n\nThis class should not be instantiated directly unless under testing conditions. Instead, obtain\nit via projection on [GMSMapView](../Classes/GMSMapView.html).\n- `\n ``\n ``\n `\n\n [-pointForCoordinate:](#/c:objc(cs)GMSProjection(im)pointForCoordinate:)`\n ` \n Maps an Earth coordinate to a point coordinate in the map's view. \n\n Declaration \n Swift \n\n func point(for coordinate: CLLocationCoordinate2D) -\u003e CGPoint\n\n Objective-C \n\n - (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n [-coordinateForPoint:](#/c:objc(cs)GMSProjection(im)coordinateForPoint:)`\n ` \n Maps a point coordinate in the map's view to an Earth coordinate. \n\n Declaration \n Swift \n\n func coordinate(for point: CGPoint) -\u003e CLLocationCoordinate2D\n\n Objective-C \n\n - (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point;\n\n- `\n ``\n ``\n `\n\n [-pointsForMeters:atCoordinate:](#/c:objc(cs)GMSProjection(im)pointsForMeters:atCoordinate:)`\n ` \n Converts a distance in meters to content size. This is only accurate for small Earth distances,\n as it uses `CGFloat` for screen distances. \n\n Declaration \n Swift \n\n func points(forMeters meters: CLLocationDistance, at coordinate: CLLocationCoordinate2D) -\u003e CGFloat\n\n Objective-C \n\n - (CGFloat)pointsForMeters:(CLLocationDistance)meters\n atCoordinate:(CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n [-containsCoordinate:](#/c:objc(cs)GMSProjection(im)containsCoordinate:)`\n ` \n Returns whether a given coordinate (lat/lng) is contained within the projection. \n\n Declaration \n Swift \n\n func contains(_ coordinate: CLLocationCoordinate2D) -\u003e Bool\n\n Objective-C \n\n - (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n [-visibleRegion](#/c:objc(cs)GMSProjection(im)visibleRegion)`\n ` \n Returns the region (four location coordinates) that is visible according to the projection. If\n padding was set on [GMSMapView](../Classes/GMSMapView.html), this region takes the padding into account.\n\n The visible region can be non-rectangular. The result is undefined if the projection includes\n points that do not map to anywhere on the map (e.g., camera sees outer space). \n\n Declaration \n Swift \n\n func visibleRegion() -\u003e ../Structs/GMSVisibleRegion.html\n\n Objective-C \n\n - (../Structs/GMSVisibleRegion.html)visibleRegion;"]]