Applies a set of restrictions to the map’s camera behavior.
Use this modifier to constrain how the user can manipulate the map’s viewpoint,
ensuring it stays within defined altitude, heading, tilt, or geographical bounds.
Applying an empty array removes any existing restrictions.
Map(mode:.hybrid).cameraRestrictions([.altitude(0...10000),// Limit zoom-out altitude.tilt(0...60)// Limit maximum tilt])
Note
If the array has more than one restriction of the same type, the last one will be
used.
A closure that the system calls when a place on the map is tapped.
This closure receives a PlaceTapInfo object containing place identifier and geographic
coordinates.
[[["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 2025-08-27 UTC."],[],[],null,["# GoogleMaps3D Framework Reference\n\nView\n====\n\n extension View where Self : MapAnimatable\n\n extension View where Self : MapAnimatable, Trigger : Equatable\n\n[Available where \\`Self\\` : \\`MapAnimatable\\`\n--------------------------------------------](#/Available-where-%60Self%60-%3A-%60MapAnimatable%60)\n\n- `\n ``\n ``\n `\n\n ### [cameraRestrictions(_:)](#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE18cameraRestrictionsyxSayAD17CameraRestrictionOGF)\n\n `\n ` \n Applies a set of restrictions to the map's camera behavior.\n\n Use this modifier to constrain how the user can manipulate the map's viewpoint,\n ensuring it stays within defined altitude, heading, tilt, or geographical bounds.\n Applying an empty array removes any existing restrictions. \n\n Map(mode: .hybrid)\n .cameraRestrictions([\n .altitude(0...10000), // Limit zoom-out altitude\n .tilt(0...60) // Limit maximum tilt\n ])\n\n Note\n\n If the array has more than one restriction of the same type, the last one will be\n used. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n func cameraRestrictions(_ restrictions: [../Enums/CameraRestriction.html]) -\u003e Self\n\n #### Parameters\n\n |----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*restrictions*` ` | An array of [CameraRestriction](../Enums/CameraRestriction.html) cases defining the limits to apply to the camera's movement and orientation. |\n\n #### Return Value\n\n The [Map](../Structs/Map.html) instance, allowing for further modifier chaining.\n- `\n ``\n ``\n `\n\n ### [onPlaceTap(_:)](#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE10onPlaceTapyxyAD0iJ4InfoVcF)\n\n `\n ` \n Adds a closure to be called when a place is tapped on the map. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n func onPlaceTap(_ handler: @escaping ((../Structs/PlaceTapInfo.html) -\u003e Void)) -\u003e Self\n\n #### Parameters\n\n |-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*handler*` ` | A closure that the system calls when a place on the map is tapped. This closure receives a [PlaceTapInfo](../Structs/PlaceTapInfo.html) object containing place identifier and geographic coordinates. |\n\n #### Return Value\n\nA new `View` with the tap handler added. \n[Available where \\`Self\\` : \\`MapAnimatable\\`, \\`Trigger\\` : \\`Equatable\\`\n-------------------------------------------------------------------------](#/Available-where-%60Self%60-%3A-%60MapAnimatable%60%2C-%60Trigger%60-%3A-%60Equatable%60)\n\n- `\n ``\n ``\n `\n\n ### [flyCameraAround(_:duration:rounds:trigger:callback:)](#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE15flyCameraAround_8duration6rounds7trigger8callbackAA15ModifiedContentVyxAD23EquatableChangeModifierVyqd__GGAD0I0V_S2dqd__yycSgtSQRd__lF)\n\n `\n ` \n Fly the camera around the given center camera with the given duration and rounds. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n func flyCameraAround\u003cTrigger\u003e(_ camera: ../Structs/Camera.html, duration: TimeInterval = 2, rounds: Double = 1, trigger: Trigger, callback: (() -\u003e Void)? = nil) -\u003e ModifiedContent\u003cSelf, EquatableChangeModifier\u003cTrigger\u003e\u003e\n\n #### Parameters\n\n |------------------|-----------------------------------------------------------|\n | ` `*camera*` ` | The center camera to fly around. |\n | ` `*duration*` ` | The duration of the animation in seconds. |\n | ` `*rounds*` ` | The number of times to fly around the center camera. |\n | ` `*trigger*` ` | The trigger to fly the camera. |\n | ` `*callback*` ` | The callback to be called when the animation is complete. |\n\n- `\n ``\n ``\n `\n\n ### [flyCameraTo(_:duration:trigger:completion:)](#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE11flyCameraTo_8duration7trigger10completionAA15ModifiedContentVyxAD23EquatableChangeModifierVyqd__GGAD0I0V_Sdqd__yycSgtSQRd__lF)\n\n `\n ` \n Fly the camera to the given destination camera with the given duration. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n func flyCameraTo\u003cTrigger\u003e(_ camera: ../Structs/Camera.html, duration: TimeInterval = 2, trigger: Trigger, completion: (() -\u003e Void)? = nil) -\u003e ModifiedContent\u003cSelf, EquatableChangeModifier\u003cTrigger\u003e\u003e\n\n #### Parameters\n\n |------------------|-------------------------------------------|\n | ` `*camera*` ` | The destination camera to fly to. |\n | ` `*duration*` ` | The duration of the animation in seconds. |\n | ` `*trigger*` ` | The trigger to fly the camera. |"]]