|
|
@@ -11,13 +11,15 @@
|
|
|
#import <CoreLocation/CoreLocation.h>
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
|
+#if __has_feature(modules)
|
|
|
+@import GoogleMapsBase;
|
|
|
+#else
|
|
|
+#import <GoogleMapsBase/GoogleMapsBase.h>
|
|
|
+#endif
|
|
|
+#import <GoogleMaps/GMSDeprecationMacros.h>
|
|
|
#import <GoogleMaps/GMSMapLayer.h>
|
|
|
#import <GoogleMaps/GMSUISettings.h>
|
|
|
|
|
|
-#ifndef __GMS_AVAILABLE_BUT_DEPRECATED
|
|
|
-#define __GMS_AVAILABLE_BUT_DEPRECATED __deprecated
|
|
|
-#endif
|
|
|
-
|
|
|
@class GMSCameraPosition;
|
|
|
@class GMSCameraUpdate;
|
|
|
@class GMSCoordinateBounds;
|
|
|
@@ -28,8 +30,10 @@
|
|
|
@class GMSOverlay;
|
|
|
@class GMSProjection;
|
|
|
|
|
|
+GMS_ASSUME_NONNULL_BEGIN
|
|
|
+
|
|
|
/** Delegate for events on GMSMapView. */
|
|
|
-@protocol GMSMapViewDelegate <NSObject>
|
|
|
+@protocol GMSMapViewDelegate<NSObject>
|
|
|
|
|
|
@optional
|
|
|
|
|
|
@@ -48,23 +52,20 @@
|
|
|
* camera positions. It is always called for the final position of an animation
|
|
|
* or gesture.
|
|
|
*/
|
|
|
-- (void)mapView:(GMSMapView *)mapView
|
|
|
- didChangeCameraPosition:(GMSCameraPosition *)position;
|
|
|
+- (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position;
|
|
|
|
|
|
/**
|
|
|
* Called when the map becomes idle, after any outstanding gestures or
|
|
|
* animations have completed (or after the camera has been explicitly set).
|
|
|
*/
|
|
|
-- (void)mapView:(GMSMapView *)mapView
|
|
|
- idleAtCameraPosition:(GMSCameraPosition *)position;
|
|
|
+- (void)mapView:(GMSMapView *)mapView idleAtCameraPosition:(GMSCameraPosition *)position;
|
|
|
|
|
|
/**
|
|
|
* Called after a tap gesture at a particular coordinate, but only if a marker
|
|
|
* was not tapped. This is called before deselecting any currently selected
|
|
|
* marker (the implicit action for tapping on the map).
|
|
|
*/
|
|
|
-- (void)mapView:(GMSMapView *)mapView
|
|
|
- didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
|
+- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
|
|
|
|
/**
|
|
|
* Called after a long-press gesture at a particular coordinate.
|
|
|
@@ -72,8 +73,7 @@
|
|
|
* @param mapView The map view that was pressed.
|
|
|
* @param coordinate The location that was pressed.
|
|
|
*/
|
|
|
-- (void)mapView:(GMSMapView *)mapView
|
|
|
- didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
|
+- (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
|
|
|
|
/**
|
|
|
* Called after a marker has been tapped.
|
|
|
@@ -89,8 +89,12 @@
|
|
|
/**
|
|
|
* Called after a marker's info window has been tapped.
|
|
|
*/
|
|
|
-- (void)mapView:(GMSMapView *)mapView
|
|
|
- didTapInfoWindowOfMarker:(GMSMarker *)marker;
|
|
|
+- (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Called after a marker's info window has been long pressed.
|
|
|
+ */
|
|
|
+- (void)mapView:(GMSMapView *)mapView didLongPressInfoWindowOfMarker:(GMSMarker *)marker;
|
|
|
|
|
|
/**
|
|
|
* Called after an overlay has been tapped.
|
|
|
@@ -116,7 +120,7 @@
|
|
|
*
|
|
|
* @return The custom info window for the specified marker, or nil for default
|
|
|
*/
|
|
|
-- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker;
|
|
|
+- (UIView *GMS_NULLABLE_PTR)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker;
|
|
|
|
|
|
/**
|
|
|
* Called when mapView:markerInfoWindow: returns nil. If this method returns a
|
|
|
@@ -125,11 +129,16 @@
|
|
|
*
|
|
|
* @param mapView The map view that was pressed.
|
|
|
* @param marker The marker that was pressed.
|
|
|
- * @return The custom view to disaply as contents in the info window, or null to
|
|
|
+ * @return The custom view to display as contents in the info window, or nil to
|
|
|
* use the default content rendering instead
|
|
|
*/
|
|
|
|
|
|
-- (UIView *)mapView:(GMSMapView *)mapView markerInfoContents:(GMSMarker *)marker;
|
|
|
+- (UIView *GMS_NULLABLE_PTR)mapView:(GMSMapView *)mapView markerInfoContents:(GMSMarker *)marker;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Called when the marker's info window is closed.
|
|
|
+ */
|
|
|
+- (void)mapView:(GMSMapView *)mapView didCloseInfoWindowOfMarker:(GMSMarker *)marker;
|
|
|
|
|
|
/**
|
|
|
* Called when dragging has been initiated on a marker.
|
|
|
@@ -155,6 +164,22 @@
|
|
|
*/
|
|
|
- (BOOL)didTapMyLocationButtonForMapView:(GMSMapView *)mapView;
|
|
|
|
|
|
+/**
|
|
|
+ * Called when tiles have just been requested or labels have just started rendering.
|
|
|
+ */
|
|
|
+- (void)mapViewDidStartTileRendering:(GMSMapView *)mapView;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Called when all tiles have been loaded (or failed permanently) and labels have been rendered.
|
|
|
+ */
|
|
|
+- (void)mapViewDidFinishTileRendering:(GMSMapView *)mapView;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Called when map is stable (tiles loaded, labels rendered, camera idle) and overlay objects have
|
|
|
+ * been rendered.
|
|
|
+ */
|
|
|
+- (void)mapViewSnapshotReady:(GMSMapView *)mapView;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
/**
|
|
|
@@ -178,6 +203,26 @@ typedef enum {
|
|
|
|
|
|
} GMSMapViewType;
|
|
|
|
|
|
+/**
|
|
|
+ * Rendering frame rates for GMSMapView.
|
|
|
+ */
|
|
|
+typedef enum {
|
|
|
+ /** Use the minimum frame rate to conserve battery usage. */
|
|
|
+ kGMSFrameRatePowerSave,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Use a median frame rate to provide smoother rendering and conserve processing cycles.
|
|
|
+ */
|
|
|
+ kGMSFrameRateConservative,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Use the maximum frame rate for a device. For low end devices this will be 30 FPS,
|
|
|
+ * for high end devices 60 FPS.
|
|
|
+ */
|
|
|
+ kGMSFrameRateMaximum,
|
|
|
+
|
|
|
+} GMSFrameRate;
|
|
|
+
|
|
|
/**
|
|
|
* This is the main class of the Google Maps SDK for iOS and is the entry point
|
|
|
* for all methods related to the map.
|
|
|
@@ -194,7 +239,7 @@ typedef enum {
|
|
|
@interface GMSMapView : UIView
|
|
|
|
|
|
/** GMSMapView delegate. */
|
|
|
-@property(nonatomic, weak) id<GMSMapViewDelegate> delegate;
|
|
|
+@property(nonatomic, weak) IBOutlet id<GMSMapViewDelegate> GMS_NULLABLE_PTR delegate;
|
|
|
|
|
|
/**
|
|
|
* Controls the camera, which defines how the map is oriented. Modification of
|
|
|
@@ -224,7 +269,7 @@ typedef enum {
|
|
|
* drawn. If it is disabled, or it is enabled but no location data is available,
|
|
|
* this will be nil. This property is observable using KVO.
|
|
|
*/
|
|
|
-@property(nonatomic, strong, readonly) CLLocation *myLocation;
|
|
|
+@property(nonatomic, strong, readonly) CLLocation *GMS_NULLABLE_PTR myLocation;
|
|
|
|
|
|
/**
|
|
|
* The marker that is selected. Setting this property selects a particular
|
|
|
@@ -232,7 +277,7 @@ typedef enum {
|
|
|
* it to nil deselects the marker, hiding the info window. This property is
|
|
|
* observable using KVO.
|
|
|
*/
|
|
|
-@property(nonatomic, strong) GMSMarker *selectedMarker;
|
|
|
+@property(nonatomic, strong) GMSMarker *GMS_NULLABLE_PTR selectedMarker;
|
|
|
|
|
|
/**
|
|
|
* Controls whether the map is drawing traffic data, if available. This is
|
|
|
@@ -289,7 +334,7 @@ typedef enum {
|
|
|
|
|
|
/**
|
|
|
* Controls the 'visible' region of the view. By applying padding an area
|
|
|
- * arround the edge of the view can be created which will contain map data
|
|
|
+ * around the edge of the view can be created which will contain map data
|
|
|
* but will not contain UI controls.
|
|
|
*
|
|
|
* If the padding is not balanced, the visual center of the view will move as
|
|
|
@@ -316,6 +361,12 @@ typedef enum {
|
|
|
*/
|
|
|
@property(nonatomic, readonly, retain) GMSMapLayer *layer;
|
|
|
|
|
|
+/**
|
|
|
+ * Controls the rendering frame rate.
|
|
|
+ * Default value is kGMSFrameRateMaximum.
|
|
|
+ */
|
|
|
+@property(nonatomic, assign) GMSFrameRate preferredFrameRate;
|
|
|
+
|
|
|
/**
|
|
|
* Builds and returns a GMSMapView, with a frame and camera target.
|
|
|
*/
|
|
|
@@ -323,11 +374,15 @@ typedef enum {
|
|
|
|
|
|
/**
|
|
|
* Tells this map to power up its renderer. This is optional and idempotent.
|
|
|
+ *
|
|
|
+ * This method is obsolete and deprecated and will be removed in a future release.
|
|
|
*/
|
|
|
- (void)startRendering __GMS_AVAILABLE_BUT_DEPRECATED;
|
|
|
|
|
|
/**
|
|
|
* Tells this map to power down its renderer. This is optional and idempotent.
|
|
|
+ *
|
|
|
+ * This method is obsolete and deprecated and will be removed in a future release.
|
|
|
*/
|
|
|
- (void)stopRendering __GMS_AVAILABLE_BUT_DEPRECATED;
|
|
|
|
|
|
@@ -350,10 +405,10 @@ typedef enum {
|
|
|
* will have a zero bearing and tilt (i.e., facing north and looking directly at
|
|
|
* the Earth). This takes the frame and padding of this GMSMapView into account.
|
|
|
*
|
|
|
- * If the bounds is nil or invalid this method will return a nil camera.
|
|
|
+ * If the bounds is invalid this method will return a nil camera.
|
|
|
*/
|
|
|
-- (GMSCameraPosition *)cameraForBounds:(GMSCoordinateBounds *)bounds
|
|
|
- insets:(UIEdgeInsets)insets;
|
|
|
+- (GMSCameraPosition *GMS_NULLABLE_PTR)cameraForBounds:(GMSCoordinateBounds *)bounds
|
|
|
+ insets:(UIEdgeInsets)insets;
|
|
|
|
|
|
/**
|
|
|
* Changes the camera according to |update|.
|
|
|
@@ -372,3 +427,5 @@ extern NSString *const kGMSAccessibilityCompass;
|
|
|
* Accessibility identifier for the "my location" button.
|
|
|
*/
|
|
|
extern NSString *const kGMSAccessibilityMyLocation;
|
|
|
+
|
|
|
+GMS_ASSUME_NONNULL_END
|