最終更新:2017-07-05 (水) 16:23:37 (2484d)
GMSMapViewDelegate
Top / GMSMapViewDelegate
関数
- GMSMapViewDelegate mapView:willMove:
- GMSMapViewDelegate mapView:idleAt:
- GMSMapViewDelegate mapView:didTapAt:?
- GMSMapViewDelegate mapView:didTap:?
定義
/** Delegate for events on GMSMapView. */ public protocol GMSMapViewDelegate : NSObjectProtocol { /** * Called before the camera on the map changes, either due to a gesture, animation (e.g., by a user * tapping on the "My Location" button) or by being updated explicitly via the camera or a * zero-length animation on layer. * * @param gesture If YES, this is occuring due to a user gesture. */ optional public func mapView(_ mapView: GMSMapView, willMove gesture: Bool) /** * Called repeatedly during any animations or gestures on the map (or once, if the camera is * explicitly set). This may not be called for all intermediate camera positions. It is always * called for the final position of an animation or gesture. */ optional public func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) /** * Called when the map becomes idle, after any outstanding gestures or animations have completed (or * after the camera has been explicitly set). */ optional public func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) /** * 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). */ optional public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) /** * Called after a long-press gesture at a particular coordinate. * * @param mapView The map view that was tapped. * @param coordinate The location that was tapped. */ optional public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) /** * Called after a marker has been tapped. * * @param mapView The map view that was tapped. * @param marker The marker that was tapped. * @return YES if this delegate handled the tap event, which prevents the map from performing its * default selection behavior, and NO if the map should continue with its default selection * behavior. */ optional public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool /** * Called after a marker's info window has been tapped. */ optional public func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) /** * Called after a marker's info window has been long pressed. */ optional public func mapView(_ mapView: GMSMapView, didLongPressInfoWindowOf marker: GMSMarker) /** * Called after an overlay has been tapped. * * This method is not called for taps on markers. * * @param mapView The map view that was tapped. * @param overlay The overlay that was tapped. */ optional public func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) /** * Called after a POI has been tapped. * * @param mapView The map view that was tapped. * @param placeID The placeID of the POI that was tapped. * @param name The name of the POI that was tapped. * @param location The location of the POI that was tapped. */ optional public func mapView(_ mapView: GMSMapView, didTapPOIWithPlaceID placeID: String, name: String, location: CLLocationCoordinate2D) /** * Called when a marker is about to become selected, and provides an optional custom info window to * use for that marker if this method returns a UIView. * * If you change this view after this method is called, those changes will not necessarily be * reflected in the rendered version. * * The returned UIView must not have bounds greater than 500 points on either dimension. As there * is only one info window shown at any time, the returned view may be reused between other info * windows. * * Removing the marker from the map or changing the map's selected marker during this call results * in undefined behavior. * * @return The custom info window for the specified marker, or nil for default */ @available(iOS 2.0, *) optional public func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? /** * Called when mapView:markerInfoWindow: returns nil. If this method returns a view, it will be * placed within the default info window frame. If this method returns nil, then the default * rendering will be used instead. * * @param mapView The map view that was pressed. * @param marker The marker that was pressed. * @return The custom view to display as contents in the info window, or nil to use the default * content rendering instead */ @available(iOS 2.0, *) optional public func mapView(_ mapView: GMSMapView, markerInfoContents marker: GMSMarker) -> UIView? /** * Called when the marker's info window is closed. */ optional public func mapView(_ mapView: GMSMapView, didCloseInfoWindowOf marker: GMSMarker) /** * Called when dragging has been initiated on a marker. */ optional public func mapView(_ mapView: GMSMapView, didBeginDragging marker: GMSMarker) /** * Called after dragging of a marker ended. */ optional public func mapView(_ mapView: GMSMapView, didEndDragging marker: GMSMarker) /** * Called while a marker is dragged. */ optional public func mapView(_ mapView: GMSMapView, didDrag marker: GMSMarker) /** * Called when the My Location button is tapped. * * @return YES if the listener has consumed the event (i.e., the default behavior should not occur), * NO otherwise (i.e., the default behavior should occur). The default behavior is for the * camera to move such that it is centered on the user location. */ optional public func didTapMyLocationButton(for mapView: GMSMapView) -> Bool /** * Called when tiles have just been requested or labels have just started rendering. */ optional public func mapViewDidStartTileRendering(_ mapView: GMSMapView) /** * Called when all tiles have been loaded (or failed permanently) and labels have been rendered. */ optional public func mapViewDidFinishTileRendering(_ mapView: GMSMapView) /** * Called when map is stable (tiles loaded, labels rendered, camera idle) and overlay objects have * been rendered. */ optional public func mapViewSnapshotReady(_ mapView: GMSMapView) }