# GoogleMaps Framework Reference

# 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 `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html`.
- `


  ### [-pointForCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSProjection#/c:objc(cs)GMSProjection(im)pointForCoordinate:)


  ` Maps an Earth coordinate to a point coordinate in the map's view.

  #### Declaration

  Swift

      func point(for coordinate: CLLocationCoordinate2D) -> CGPoint

  Objective-C

      - (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;

- `


  ### [-coordinateForPoint:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSProjection#/c:objc(cs)GMSProjection(im)coordinateForPoint:)


  ` Maps a point coordinate in the map's view to an Earth coordinate.

  #### Declaration

  Swift

      func coordinate(for point: CGPoint) -> CLLocationCoordinate2D

  Objective-C

      - (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point;

- `


  ### [-pointsForMeters:atCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSProjection#/c:objc(cs)GMSProjection(im)pointsForMeters:atCoordinate:)


  ` Converts a distance in meters to content size. This is only accurate for small Earth distances,
  as it uses `CGFloat` for screen distances.

  #### Declaration

  Swift

      func points(forMeters meters: CLLocationDistance, at coordinate: CLLocationCoordinate2D) -> CGFloat

  Objective-C

      - (CGFloat)pointsForMeters:(CLLocationDistance)meters
                    atCoordinate:(CLLocationCoordinate2D)coordinate;

- `


  ### [-containsCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSProjection#/c:objc(cs)GMSProjection(im)containsCoordinate:)


  ` Returns whether a given coordinate (lat/lng) is contained within the projection.

  #### Declaration

  Swift

      func contains(_ coordinate: CLLocationCoordinate2D) -> Bool

  Objective-C

      - (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate;

- `


  ### [-visibleRegion](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSProjection#/c:objc(cs)GMSProjection(im)visibleRegion)


  ` Returns the region (four location coordinates) that is visible according to the projection. If
  padding was set on `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html`, 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).

  #### Declaration

  Swift

      func visibleRegion() -> https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Structs/GMSVisibleRegion.html

  Objective-C

      - (https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Structs/GMSVisibleRegion.html)visibleRegion;