ক্যামেরা সামঞ্জস্য করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ক্যামেরা আপনাকে মানচিত্রের ব্যবহারকারীর দৃষ্টিভঙ্গি পরিবর্তন করতে দেয়। নেভিগেশন চলাকালীন মানচিত্রের আচরণ নিয়ন্ত্রণ করতে আপনি ক্যামেরা মোড ব্যবহার করতে পারেন। ক্যামেরা মোড সেট করতে, নিম্নলিখিত ক্যামেরা মোড ধ্রুবকগুলির মধ্যে একটি নির্দিষ্ট করে মানচিত্র দৃশ্যের cameraMode
বৈশিষ্ট্য সেট করুন:
অনুসরণ করা হচ্ছে — নেভিগেশনের জন্য ডিফল্ট ক্যামেরা মোড। ভিউ অ্যাঙ্গেল 45 ডিগ্রীতে পরিবর্তন করে এবং ক্যামেরাটিকে ভ্রমণের দিকের দিকে মুখ করে বর্তমান অবস্থানের পিছনে রাখে। নেভিগেশন চলাকালীন ক্যামেরা স্বয়ংক্রিয়ভাবে ভ্রমণের দিকে মুখের সাথে সামঞ্জস্য করে। ম্যাপের রি-সেন্টার বোতাম টিপেও এই মোডে স্যুইচ হবে৷ যখন এই মোডটি নির্বাচন করা হয় তখন পুনরায় কেন্দ্র বোতামটি দৃশ্যমান হয় না৷
ওভারভিউ — পুরো রুটের একটি ওভারভিউ দেখায়, ম্যাপ ভিউতে রুট ফিট করার জন্য প্রয়োজন অনুযায়ী জুম করে। যখন এই দৃশ্যটি নির্বাচন করা হয় তখন পুনরায় কেন্দ্র বোতামটি দৃশ্যমান হয়৷
বিনামূল্যে — ব্যবহারকারীকে অঙ্গভঙ্গি সহ মানচিত্রের দৃশ্য পরিবর্তন করতে দেয়৷ এই দৃশ্যে ক্যামেরা স্থির থাকে। ন্যাভিগেশনের সময় ব্যবহারকারী প্যান বা জুম করলে মানচিত্রটি স্বয়ংক্রিয়ভাবে এই দৃশ্যে প্রবেশ করবে। যখন এই দৃশ্যটি নির্বাচন করা হয় তখন পুনরায় কেন্দ্র বোতামটি দৃশ্যমান হয়৷
ক্যামেরা মোড পরিবর্তন করতে, মানচিত্র দৃশ্যের cameraMode
বৈশিষ্ট্য সেট করুন, এখানে দেখানো হয়েছে:
সুইফট
// Set the mode to "overview":
mapView.cameraMode = .overview
// Set the mode to "free":
mapView.cameraMode = .free
// Set the mode to "following":
mapView.cameraMode = .following
উদ্দেশ্য-C
// Set the mode to "overview":
mapView.cameraMode = GMSNavigationCameraModeOverview;
// Set the mode to "free":
mapView.cameraMode = GMSNavigationCameraModeFree;
// Set the mode to "following":
mapView.cameraMode = GMSNavigationCameraModeFollowing;
মানচিত্রটি স্বয়ংক্রিয়ভাবে রিসেন্টার করুন
ব্যবহারকারীরা যখন ন্যাভিগেশন মোডে মানচিত্র সরান, তখন মানচিত্র দেখার জন্য ক্যামেরা মোড নিম্নলিখিত মোড থেকে ফ্রি মোডে পরিবর্তিত হয়। যখন ব্যবহারকারী স্পষ্টভাবে রি-সেন্টার চাপেন তখন ক্যামেরাটি নিম্নলিখিত মোডে ফিরে আসে। আপনি একটি টাইমার ব্যবহার করে নিম্নলিখিত মোডে প্রত্যাবর্তন স্বয়ংক্রিয়ভাবে নিম্নলিখিত মোড ছেড়ে যাওয়ার মধ্যে একটি ব্যবধান সেট করতে পারেন এবং তারপর স্বয়ংক্রিয়ভাবে এটিতে ফিরে যেতে পারেন।
উদাহরণ
ন্যাভিগেশন মোডে থাকাকালীন ব্যবহারকারীর দ্বারা মানচিত্রটি সরানো হচ্ছে কিনা তা নির্ধারণ করতে নিম্নলিখিত কোড উদাহরণটি পরীক্ষা করে। যদি এটি হয়, তাহলে এটি পাঁচ সেকেন্ড পর মানচিত্রকে কেন্দ্র করে ক্যামেরা মোডকে নিম্নলিখিত মোডে স্যুইচ করার জন্য একটি টাইমার সেট করে।
সুইফট
class YourViewController: UIViewController {
@IBOutlet weak var mapView: GMSMapView!
var autoFollowTimer: Timer!
override func viewDidLoad() {
super.viewDidLoad()
mapView.delegate = self
...
}
...
}
/** Implements the GMSMapViewDelegate protocol. */
extension YourViewController: GMSMapViewDelegate {
func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
if mapView.navigator?.isGuidanceActive == false {return}
if !gesture {return}
autoFollowTimer?.invalidate()
autoFollowTimer = Timer(
timeInterval: TimeInterval(5.0),
target: self,
selector: #selector(recenterMap),
userInfo: nil,
repeats: false)
RunLoop.current.add(autoFollowTimer, forMode: .default)
}
/** Centers the map in guidance mode. */
@objc private func recenterMap() {
if mapView.navigator?.isGuidanceActive == true {
mapView.cameraMode = .following
}
autoFollowTimer.invalidate()
autoFollowTimer = nil
}
}
উদ্দেশ্য-C
@interface YourViewController : UIViewController<GMSMapViewDelegate>
...
@end
@implementation YourViewController {
GMSMapView *_mapView;
NSTimer *_autoFollowTimer;
...
}
...
- (void)viewDidLoad {
[super viewDidLoad];
...
_mapView.delegate = self;
...
}
...
/** Implements the GMSMapViewDelegate protocol. */
- (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture {
if (!_mapView.navigator.guidanceActive) return;
if (!gesture) return;
[_autoFollowTimer invalidate];
_autoFollowTimer = [NSTimer scheduledTimerWithTimeInterval:5.0
target:self
selector:@selector(recenterMap)
userInfo:nil
repeats:NO];
}
/** Centers the map in guidance mode. */
- (void)recenterMap {
if (_mapView.navigator.guidanceActive) {
_mapView.cameraMode = GMSNavigationCameraModeFollowing;
}
[_autoFollowTimer invalidate];
_autoFollowTimer = nil;
}
@end
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-09-04 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-09-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eYou can change the user's viewpoint of the map by setting the \u003ccode\u003ecameraMode\u003c/code\u003e property to \u003ccode\u003efollowing\u003c/code\u003e, \u003ccode\u003eoverview\u003c/code\u003e, or \u003ccode\u003efree\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFollowing\u003c/code\u003e mode puts the camera behind the current position, \u003ccode\u003eoverview\u003c/code\u003e mode displays the entire route, and \u003ccode\u003efree\u003c/code\u003e mode allows user interaction.\u003c/p\u003e\n"],["\u003cp\u003eThe map automatically enters \u003ccode\u003efree\u003c/code\u003e mode when the user pans or zooms, and a \u003cstrong\u003eRe-center\u003c/strong\u003e button is available in \u003ccode\u003eoverview\u003c/code\u003e and \u003ccode\u003efree\u003c/code\u003e modes to return to \u003ccode\u003efollowing\u003c/code\u003e mode.\u003c/p\u003e\n"],["\u003cp\u003eYou can automate the return to \u003ccode\u003efollowing\u003c/code\u003e mode after a set time interval using a timer to improve user experience.\u003c/p\u003e\n"]]],[],null,["# Adjust the camera\n\nThe [camera](/maps/documentation/ios-sdk/views) allows you to change the user's\nviewpoint of the map. You can use camera modes to control the behavior of the\nmap during navigation. To set the camera mode, set the `cameraMode` property of\nthe map view, specifying one of the following camera mode constants:\n\n- Following --- The default camera mode for navigation. Changes the view\n angle to 45 degrees and puts the camera behind the current position facing in\n the direction of travel. During navigation the camera automatically adjusts\n to face in the direction of travel. Pressing the map's **Re-center** button\n will also switch to this mode. The **Re-center** button is not visible when\n this mode is selected.\n\n- Overview --- Displays an overview of the entire route, zooming as needed\n to fit the route into the map view. When this view is selected the\n **Re-center** button is visible.\n\n- Free --- Lets the user change the map view with [gestures](/maps/documentation/navigation/ios-sdk/controls).\n The camera remains stationary in this view. The map will automatically enter\n this view if the user pans or zooms during navigation. When this view is\n selected the **Re-center** button is visible.\n\nTo change the camera mode, set the `cameraMode` property of the map view, as\nshown here:\n\n\u003cbr /\u003e\n\n### Swift\n\n\u003cbr /\u003e\n\n // Set the mode to \"overview\":\n mapView.cameraMode = .overview\n\n // Set the mode to \"free\":\n mapView.cameraMode = .free\n\n // Set the mode to \"following\":\n mapView.cameraMode = .following\n\n\u003cbr /\u003e\n\n### Objective-C\n\n\u003cbr /\u003e\n\n // Set the mode to \"overview\":\n mapView.cameraMode = GMSNavigationCameraModeOverview;\n\n // Set the mode to \"free\":\n mapView.cameraMode = GMSNavigationCameraModeFree;\n\n // Set the mode to \"following\":\n mapView.cameraMode = GMSNavigationCameraModeFollowing;\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nAutomatically recenter the map\n------------------------------\n\nWhen users move the map in Navigation mode, the camera mode for the map\nview changes from following mode to free mode. The camera returns to following\nmode when the user explicitly presses **Re-center**. You can automate the\nreturn to following mode by using a timer to set an interval between leaving\nfollowing mode, and then automatically returning to it.\n\n### Example\n\nThe following code example checks to determine whether the map is being moved by\nthe user while in Navigation mode. If it is, then it sets a timer to switch the\ncamera mode to following mode, centering the map after five seconds.\n\n\u003cbr /\u003e\n\n### Swift\n\n\u003cbr /\u003e\n\n class YourViewController: UIViewController {\n\n @IBOutlet weak var mapView: GMSMapView!\n var autoFollowTimer: Timer!\n\n override func viewDidLoad() {\n super.viewDidLoad()\n mapView.delegate = self\n ...\n }\n\n ...\n }\n\n /** Implements the GMSMapViewDelegate protocol. */\n extension YourViewController: GMSMapViewDelegate {\n func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {\n if mapView.navigator?.isGuidanceActive == false {return}\n if !gesture {return}\n\n autoFollowTimer?.invalidate()\n autoFollowTimer = Timer(\n timeInterval: TimeInterval(5.0),\n target: self,\n selector: #selector(recenterMap),\n userInfo: nil,\n repeats: false)\n RunLoop.current.add(autoFollowTimer, forMode: .default)\n }\n\n /** Centers the map in guidance mode. */\n @objc private func recenterMap() {\n if mapView.navigator?.isGuidanceActive == true {\n mapView.cameraMode = .following\n }\n\n autoFollowTimer.invalidate()\n autoFollowTimer = nil\n }\n }\n\n\u003cbr /\u003e\n\n### Objective-C\n\n\u003cbr /\u003e\n\n @interface YourViewController : UIViewController\u003cGMSMapViewDelegate\u003e\n ...\n @end\n\n\n @implementation YourViewController {\n GMSMapView *_mapView;\n NSTimer *_autoFollowTimer;\n ...\n }\n\n ...\n\n - (void)viewDidLoad {\n [super viewDidLoad];\n ...\n _mapView.delegate = self;\n ...\n }\n\n ...\n\n /** Implements the GMSMapViewDelegate protocol. */\n - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture {\n if (!_mapView.navigator.guidanceActive) return;\n if (!gesture) return;\n\n [_autoFollowTimer invalidate];\n _autoFollowTimer = [NSTimer scheduledTimerWithTimeInterval:5.0\n target:self\n selector:@selector(recenterMap)\n userInfo:nil\n repeats:NO];\n }\n\n /** Centers the map in guidance mode. */\n - (void)recenterMap {\n if (_mapView.navigator.guidanceActive) {\n _mapView.cameraMode = GMSNavigationCameraModeFollowing;\n }\n\n [_autoFollowTimer invalidate];\n _autoFollowTimer = nil;\n }\n\n @end\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]