This is the main class of the Google Maps SDK for iOS and is the entry point for all methods related to the map.
The map should be instantiated with one of the constructors -init or -initWithOptions:.
GMSMapView
can only be read and modified from the main thread, similar to all UIKit objects. Calling these methods from another thread will result in an exception or undefined behavior.
Public Member Functions
|
(instancetype)
| -
init
|
| Initializes with CGRectZero and default options.
|
(instancetype)
| -
initWithOptions:
|
| Creates a new map view with the given options.
|
(instancetype)
| -
initWithFrame:
|
(nullable instancetype)
| -
initWithCoder:
|
(instancetype)
| -
initWithFrame:camera:
|
| Builds and returns a map view, with a frame and camera target.
|
(instancetype)
| -
initWithFrame:mapID:camera:
|
| Builds and returns a map view with a frame, map ID, and camera target.
|
(void)
| -
startRendering
|
| Tells this map to power up its renderer.
|
(void)
| -
stopRendering
|
| Tells this map to power down its renderer.
|
(void)
| -
clear
|
| Clears all markup that has been added to the map, including markers, polylines and ground overlays.
|
(void)
| -
setMinZoom:maxZoom:
|
| Sets
minZoom
and
maxZoom
.
|
(nullable
GMSCameraPosition
*)
| -
cameraForBounds:insets:
|
| Build a
GMSCameraPosition
that presents
bounds
with
padding
.
|
(void)
| -
moveCamera:
|
| Changes the camera according to
update
.
|
(BOOL)
| -
areEqualForRenderingPosition:position:
|
| Check whether the given camera positions would practically cause the camera to be rendered the same, taking into account the level of precision and transformations used internally.
|
(
GMSFeatureLayer
<
GMSPlaceFeature
* > *)
| -
featureLayerOfFeatureType:
|
| Returns a feature layer of the specified type.
|
(
GMSDatasetFeatureLayer
*)
| -
datasetFeatureLayerOfDatasetID:
|
| Returns a dataset feature layer of the specified dataset.
|
(void)
| -
animateToCameraPosition:
|
| Animates the camera of this map to
cameraPosition
.
|
(void)
| -
animateToLocation:
|
| As animateToCameraPosition:, but changes only the location of the camera (i.e., from the current location to
location
).
|
(void)
| -
animateToZoom:
|
| As animateToCameraPosition:, but changes only the zoom level of the camera.
|
(void)
| -
animateToBearing:
|
| As animateToCameraPosition:, but changes only the bearing of the camera (in degrees).
|
(void)
| -
animateToViewingAngle:
|
| As animateToCameraPosition:, but changes only the viewing angle of the camera (in degrees).
|
(void)
| -
animateWithCameraUpdate:
|
| Applies
cameraUpdate
to the current camera, and then uses the result as per animateToCameraPosition:.
|
Static Public Member Functions
|
(instancetype)
| +
mapWithFrame:camera:
|
| Builds and returns a map view with a frame and camera target.
|
(instancetype)
| +
mapWithFrame:mapID:camera:
|
| Convenience initializer to build and return a map view with a frame, map ID, and camera target.
|
Properties
|
IBOutlet id<
GMSMapViewDelegate
>
| delegate
|
| GMSMapView
delegate.
|
GMSCameraPosition
*
| camera
|
| Controls the camera, which defines how the map is oriented.
|
GMSProjection
*
| projection
|
| Returns a
GMSProjection
object that you can use to convert between screen coordinates and latitude/longitude coordinates.
|
BOOL
| myLocationEnabled
|
| Controls whether the My Location dot and accuracy circle is enabled.
|
CLLocation *
| myLocation
|
| If My Location is enabled, reveals where the device location dot is being drawn.
|
GMSMarker
*
| selectedMarker
|
| The marker that is selected.
|
BOOL
| trafficEnabled
|
| Controls whether the map is drawing traffic data, if available.
|
GMSMapViewType
| mapType
|
| Controls the type of map tiles that should be displayed.
|
GMSMapStyle
*
| mapStyle
|
| Controls the style of the map.
|
UIUserInterfaceStyle
| overrideUserInterfaceStyle
|
| Change the map to desired
UIUserInterfaceStyle
.
|
float
| minZoom
|
| Minimum zoom (the farthest the camera may be zoomed out).
|
float
| maxZoom
|
| Maximum zoom (the closest the camera may be to the Earth).
|
BOOL
| buildingsEnabled
|
| If set, 3D buildings will be shown where available.
|
BOOL
| indoorEnabled
|
| Sets whether indoor maps are shown, where available.
|
GMSIndoorDisplay
*
| indoorDisplay
|
| Gets the
GMSIndoorDisplay
instance which allows to observe or control aspects of indoor data display.
|
GMSUISettings
*
| settings
|
| Gets the
GMSUISettings
object, which controls user interface settings for the map.
|
UIEdgeInsets
| padding
|
| Controls the 'visible' region of the view.
|
GMSMapViewPaddingAdjustmentBehavior
| paddingAdjustmentBehavior
|
| Controls how safe area insets are added to the padding values.
|
BOOL
| accessibilityElementsHidden
|
| Defaults to YES.
|
GMSMapLayer
*
| layer
|
| Accessor for the custom CALayer type used for the layer.
|
GMSFrameRate
| preferredFrameRate
|
| Controls the rendering frame rate.
|
GMSCoordinateBounds
*
| cameraTargetBounds
|
| If not nil, constrains the camera target so that gestures cannot cause it to leave the specified bounds.
|
GMSMapCapabilityFlags
| mapCapabilities
|
| All conditionally-available (dependent on mapID or other map settings) capabilities that are available at the current moment in time.
|
|
(Note that these are not member functions.)
|
NSString *const
| kGMSAccessibilityCompass
|
| Accessibility identifier for the compass button.
|
NSString *const
| kGMSAccessibilityMyLocation
|
| Accessibility identifier for the "my location" button.
|
NSString *const
| kGMSAccessibilityOutOfQuota
|
| Accessibility identifier for the "out of quota" error label.
|