iOS-এর জন্য নেভিগেশন SDK ব্যবহার করে, আপনি আপনার ম্যাপের ইউজার এক্সপেরিয়েন্স পরিবর্তন করতে পারেন। এর জন্য আপনি নির্ধারণ করতে পারবেন যে কোন বিল্ট-ইন UI কন্ট্রোল ও এলিমেন্টগুলো ম্যাপে প্রদর্শিত হবে এবং কোন জেসচারগুলো ব্যবহারের অনুমতি দেওয়া হবে। এছাড়াও আপনি নেভিগেশন UI-এর ভিজ্যুয়াল চেহারা পরিবর্তন করতে পারেন। নেভিগেশন UI-তে গ্রহণযোগ্য পরিবর্তনগুলো সম্পর্কে নির্দেশনার জন্য পলিসি পেজটি দেখুন।
Map UI controls
নেভিগেশন এসডিকে-তে কিছু বিল্ট-ইন ইউআই কন্ট্রোল রয়েছে, যা আইওএস অ্যাপ্লিকেশনের জন্য গুগল ম্যাপস-এর কন্ট্রোলগুলোর অনুরূপ। আপনি GMSUISettings ক্লাসটি ব্যবহার করে এই কন্ট্রোলগুলোর দৃশ্যমানতা পরিবর্তন করতে পারেন। এই ক্লাসে করা পরিবর্তনগুলো ম্যাপে তাৎক্ষণিকভাবে প্রতিফলিত হয়।
কম্পাস
নেভিগেশন এসডিকে একটি কম্পাস গ্রাফিক প্রদান করে, যা নির্দিষ্ট পরিস্থিতিতে এবং শুধুমাত্র সক্রিয় করা হলেই ম্যাপের উপরের ডান কোণায় প্রদর্শিত হয়। যখন ব্যবহারকারী কম্পাসটিতে ক্লিক করেন, তখন ক্যামেরাটি অ্যানিমেট করে শূন্য বেয়ারিং-এর একটি অবস্থানে (ডিফল্ট ওরিয়েন্টেশন) ফিরে আসে এবং এর কিছুক্ষণ পরেই কম্পাসটি মিলিয়ে যায়।
যদি নেভিগেশন চালু থাকে এবং ক্যামেরা মোড 'ফলোয়িং'-এ সেট করা থাকে, তাহলে কম্পাসটি দৃশ্যমান থাকে এবং কম্পাসে ট্যাপ করলে টিল্টেড ও ওভারভিউ ক্যামেরা পার্সপেক্টিভের মধ্যে টগল হয়।
চালকের মনোযোগে ব্যাঘাত এড়ানোর জন্য, যদি হেডারটি (পোর্ট্রেট মোডে) প্রসারিত হয় এবং কম্পাসের ডিফল্ট অবস্থানের সাথে সাংঘর্ষিক হয়, তাহলেও কম্পাসটি একই অবস্থানে থাকে। যদি আপনি একটি সেকেন্ডারি হেডার কাস্টম কন্ট্রোল বা হেডার অ্যাকসেসরি ভিউ যোগ করেন, তাহলে UI দ্বন্দ্ব এড়ানোর জন্য কম্পাসটি লুকানো থাকে।
কম্পাসটি দিন ও রাতের মোডের পাশাপাশি ডার্ক মোডও সমর্থন করে।
The compass is disabled by default. You can enable the compass by setting the compassButton property of GMSUISettings to true . However, you cannot force the compass to always be shown.
সুইফট
mapView.settings.compassButton = true
উদ্দেশ্য-সি
mapView.settings.compassButton = YES;
আমার অবস্থান বোতাম
'আমার অবস্থান' বাটনটি স্ক্রিনের নিচের ডান কোণায় তখনই দেখা যায়, যখন এটি সক্রিয় করা থাকে। যখন কোনো ব্যবহারকারী বাটনটিতে ক্লিক করেন, তখন ব্যবহারকারীর অবস্থান জানা থাকলে ক্যামেরাটি অ্যানিমেট করে তার বর্তমান অবস্থানে ফোকাস করে। আপনি GMSUISettings এর myLocationButton প্রপার্টিকে true সেট করে বাটনটি সক্রিয় করতে পারেন।
সুইফট
mapView.settings.myLocationButton = true
উদ্দেশ্য-সি
mapView.settings.myLocationButton = YES;
Recenter button
যখন নেভিগেশন সক্রিয় থাকে, তখন ব্যবহারকারী ম্যাপ ভিউ স্ক্রোল করলে রিসেন্টার বাটনটি দেখা যায় এবং ম্যাপটিকে পুনরায় কেন্দ্রে আনতে ট্যাপ করলে তা অদৃশ্য হয়ে যায়। রিসেন্টার বাটনটি দেখানোর জন্য, GMSUISettings এর recenterButtonEnabled প্রপার্টিটি true তে সেট করুন। রিসেন্টার বাটনটি দেখানো বন্ধ করতে, recenterButtonEnabled কে false এ সেট করুন।
সুইফট
mapView.settings.isRecenterButtonEnabled = true
উদ্দেশ্য-সি
mapView.settings.recenterButtonEnabled = YES;
Map UI accessories
নেভিগেশন এসডিকে এমন UI অ্যাক্সেসরিজ প্রদান করে যা নেভিগেশনের সময় প্রদর্শিত হয়, যা iOS অ্যাপ্লিকেশনের জন্য Google Maps-এ পাওয়া অ্যাক্সেসরিজগুলোর অনুরূপ। এই বিভাগে বর্ণিত পদ্ধতি অনুযায়ী আপনি এই কন্ট্রোলগুলোর দৃশ্যমানতা বা বাহ্যিক রূপ সামঞ্জস্য করতে পারেন। এখানে আপনার করা পরিবর্তনগুলো ব্যবহারকারীর পরবর্তী যাত্রায় প্রতিফলিত হবে।
Navigation header and footer

নেভিগেশনের সময়, স্ক্রিনের উপরে নেভিগেশন হেডার এবং নীচে নেভিগেশন ফুটার দেখা যায়। নেভিগেশন হেডারে রাস্তার নাম এবং রুটের পরবর্তী মোড়ের দিকনির্দেশনা, সেইসাথে তার পরের মোড়ের দিকনির্দেশনা দেখানো হয়। নেভিগেশন ফুটারে গন্তব্যে পৌঁছানোর আনুমানিক সময় ও দূরত্ব, সেইসাথে পৌঁছানোর আনুমানিক সময় দেখানো হয়।
নিম্নলিখিত প্রোপার্টিগুলো ব্যবহার করে আপনি প্রোগ্রাম্যাটিকভাবে নেভিগেশন হেডার ও ফুটারের দৃশ্যমানতা পরিবর্তন করতে এবং এর রং নির্ধারণ করতে পারেন:
-
navigationHeaderEnabled— নেভিগেশন হেডারটি দৃশ্যমান হবে কিনা তা নিয়ন্ত্রণ করে (ডিফল্ট হলোtrue)। -
navigationFooterEnabled— controls whether the navigation footer is visible (default istrue). -
navigationHeaderPrimaryBackgroundColor— নেভিগেশন হেডারের প্রাথমিক ব্যাকগ্রাউন্ড কালার নির্ধারণ করে। -
navigationHeaderSecondaryBackgroundColor— sets the secondary background color for the navigation header.
নিম্নলিখিত কোড উদাহরণটিতে হেডার ও ফুটারের ভিজিবিলিটি চালু করা, তারপর navigationHeaderPrimaryBackgroundColor কে নীল এবং navigationHeaderSecondaryBackgroundColor কে লাল রঙে সেট করা দেখানো হয়েছে।
সুইফট
mapView.settings.isNavigationHeaderEnabled = true
mapView.settings.isNavigationFooterEnabled = true
mapView.settings.navigationHeaderPrimaryBackgroundColor = .blue
mapView.settings.navigationHeaderSecondaryBackgroundColor = .red
উদ্দেশ্য-সি
mapView.settings.navigationHeaderEnabled = YES;
mapView.settings.navigationFooterEnabled = YES;
mapView.settings.navigationHeaderPrimaryBackgroundColor = [UIColor blueColor];
mapView.settings.navigationHeaderSecondaryBackgroundColor = [UIColor redColor];
Navigation accessory header view
You can customize your app by replacing the secondary navigation header view with your own customized accessory view. You do it by creating a view that implements the GMSNavigationAccessoryView protocol. This protocol has one required method: -heightForAccessoryViewConstrainedToSize:onMapView: . You are given the maximum available size for your view on the given mapView, and you must provide the height that your view requires.
এরপর আপনি setHeaderAccessoryView: mapView বর্তমান ভিউগুলোকে অ্যানিমেট করে সরিয়ে দেয় এবং তারপর আপনার কাস্টম ভিউটিকে অ্যানিমেট করে নিয়ে আসে। নেভিগেশন হেডারটি অবশ্যই দৃশ্যমান থাকতে হবে, যাতে আপনার কাস্টম ভিউটি প্রদর্শিত হতে পারে।
কাস্টম হেডার অ্যাকসেসরি ভিউটি অপসারণ করতে, setHeaderAccessoryView: এ nil পাস করুন: ।
যদি আপনার ভিউয়ের আকার যেকোনো সময় পরিবর্তন করার প্রয়োজন হয়, তাহলে যে ভিউটির আকার পরিবর্তন করতে হবে সেটিকে পাস করে আপনি invalidateLayoutForAccessoryView: কল করতে পারেন।
উদাহরণ
নিম্নলিখিত কোড উদাহরণটি GMSNavigationAccessoryView প্রোটোকল বাস্তবায়নকারী একটি কাস্টম ভিউ প্রদর্শন করে। এই কাস্টম ভিউটি পরবর্তীতে একটি কাস্টম নেভিগেশন হেডার অ্যাক্সেসরি ভিউ সেট করতে ব্যবহৃত হয়।
সুইফট
class MyCustomView: UIView, GMSNavigationAccessoryView {
…
func heightForAccessoryViewConstrained(to size: CGSize, on mapView: GMSMapView) -> CGFloat {
// viewHeight gets calculated as the height your view needs.
return viewHeight
}
…
}
let customView = MyCustomView(...)
mapView.setHeaderAccessory(customView)
// At some later point customView changes size.
mapView.invalidateLayout(forAccessoryView: customView)
// Remove the custom header accessory view.
mapView.setHeaderAccessory(nil)
উদ্দেশ্য-সি
@interface MyCustomView : UIView <GMSNavigationAccessoryView>
…
@end
@implementation MyCustomView
…
- (CGFloat)heightForAccessoryViewConstrainedToSize:(CGSize)size onMapView:(GMSMapView *)mapView {
// viewHeight gets calculated as the height your view needs.
return viewHeight;
}
…
@end
MyCustomView *customView = [[MyCustomView alloc] init…];
[_mapView setHeaderAccessoryView:customView];
// At some later point customView changes size.
[_mapView invalidateLayoutForAccessoryView:customView];
// Remove the custom header accessory view.
[_mapView setHeaderAccessoryView:nil];
Normal and low-light modes
GMSNavigatorListener.didChangeSuggestedLightingMode লিসেনার মেথডটি আনুমানিক আলোর অবস্থা আপডেট হলে ট্রিগার হয়। উদাহরণস্বরূপ, যখন ডিভাইসটির বর্তমান অবস্থানে রাত হয়। আপনি নিম্নলিখিত উপায়ে প্রোগ্রাম্যাটিকভাবে লো-লাইট মোডের আচরণ পরিবর্তন করতে পারেন:
- Choose when normal and low-light modes are used by using the
GMSNavigationLightingModeenum. -
navigationHeaderPrimaryBackgroundColorNightModeএবংnavigationHeaderSecondaryBackgroundColorNightModeপ্রপার্টিগুলোর মান নির্ধারণ করে লো-লাইট মোডের প্রাথমিক এবং মাধ্যমিক ব্যাকগ্রাউন্ড রঙ নির্বাচন করুন।
Directions List
আপনি আপনার অ্যাপে ধাপে ধাপে নির্দেশনা দিতে পারেন। নিচের উদাহরণটি এটি করার একটি সম্ভাব্য উপায় দেখাচ্ছে। আপনার নিজস্ব বাস্তবায়নের উপর নির্ভর করে এই ধাপগুলো ভিন্ন হতে পারে।
-
GMSNavigator(নেভিগেটর)-এsetDestinationsসফলভাবে সম্পন্ন হওয়ার পর এবং নেভিগেটরেguidanceActiveসক্রিয় হয়ে গেলে একটি এন্ট্রি পয়েন্ট বাটন সক্রিয় করুন। - ব্যবহারকারী এন্ট্রি পয়েন্ট বোতামে ট্যাপ করলে,
GMSMapView(mapView)-এর সাথে যুক্ত নেভিগেটরসহ একটিGMSNavigationDirectionsListController(কন্ট্রোলার) তৈরি করুন। -
UIViewController(ভিউ কন্ট্রোলার)-এর একটি ইনস্ট্যান্সে কন্ট্রোলারটি যোগ করুন এবংdirectionsListViewকে ভিউ কন্ট্রোলারটির একটি সাবভিউ হিসেবে যুক্ত করুন। কন্ট্রোলারেরreloadDataএবংinvalidateLayoutমেথডগুলোUICollectionViewএর মতোই কল করতে হবে। - অ্যাপের ভিউ কন্ট্রোলার হায়ারার্কিতে ভিউ কন্ট্রোলারটি যুক্ত করুন।
The following code example shows adding a DirectionsListViewController .
সুইফট
override func viewDidLoad() {
super.viewDidLoad()
// Add the directionsListView to the host view controller's view.
let directionsListView = directionsListController.directionsListView
directionsListView.frame = self.view.frame
self.view.addSubview(directionsListView)
directionsListView.translatesAutoresizingMaskIntoConstraints = false
directionsListView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
directionsListView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
directionsListView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
directionsListView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
...
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Make sure data is fresh when the view appears.
directionsListController.reloadData()
...
}
override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
super.willTransition(to: newCollection, with: coordinator)
// Invalidate the layout during rotation.
coordinator.animate(alongsideTransition: {_ in
self.directionsListController.invalidateLayout()
})
...
}
উদ্দেশ্য-সি
- (void)viewDidLoad {
[super viewDidLoad];
// Add the directionsListView to the host view controller's view.
UIView *directionsListView = _directionsListController.directionsListView;
directionsListView.frame = self.view.bounds;
[self.view addSubview:directionsListView];
directionsListView.translatesAutoresizingMaskIntoConstraints = NO;
[directionsListView.topAnchor constraintEqualToAnchor:self.view.topAnchor].active = YES;
[directionsListView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
[directionsListView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
[directionsListView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = YES;
...
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Make sure data is fresh when the view appears.
[_directionsListController reloadData];
...
}
- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
void(^animationBlock)(id <UIViewControllerTransitionCoordinatorContext>context) =
^void(id <UIViewControllerTransitionCoordinatorContext>context) {
[_directionsListController invalidateLayout];
};
// Invalidate the layout during rotation.
[coordinator animateAlongsideTransition:animationBlock
completion:nil];
...
}
...
Trip progress bar

ট্রিপ প্রোগ্রেস বার হলো একটি উল্লম্ব বার যা নেভিগেশন শুরু হলে ম্যাপের শুরুর দিকে প্রদর্শিত হয়। এটি সক্রিয় করা হলে, ব্যবহারকারীর গন্তব্য এবং বর্তমান অবস্থানের সাথে সম্পূর্ণ ট্রিপের একটি সার্বিক চিত্র প্রদর্শন করে।
এটি ব্যবহারকারীদের জুম ইন না করেই ট্র্যাফিকের মতো যেকোনো আসন্ন সমস্যা দ্রুত অনুমান করার ক্ষমতা দেয়। এরপর প্রয়োজনে তারা যাত্রাপথ পরিবর্তন করতে পারেন। যদি ব্যবহারকারী যাত্রাপথ পরিবর্তন করেন, তাহলে প্রোগ্রেস বারটি এমনভাবে রিসেট হয়ে যায় যেন সেই বিন্দু থেকে একটি নতুন যাত্রা শুরু হয়েছে।
ট্রিপের অগ্রগতি বারটি নিম্নলিখিত স্থিতি সূচকগুলি প্রদর্শন করে:
Traffic status —the status of upcoming traffic.
বর্তমান অবস্থান — যাত্রাপথে চালকের বর্তমান অবস্থান।
Route elapsed —the elapsed portion of the trip.
GMSUISettings এ navigationTripProgressBarEnabled প্রপার্টি সেট করে ট্রিপ প্রোগ্রেস বার সক্রিয় করুন।
সুইফট
mapView.settings.isNavigationTripProgressBarEnabled = true
উদ্দেশ্য-সি
mapView.settings.navigationTripProgressBarEnabled = YES;
Trip progress bar positioning
- বারটির বাম দিকটি মোটামুটিভাবে স্পিডোমিটার, গুগল লোগো এবং রি-সেন্টার বাটনের (যখন দৃশ্যমান থাকে) বাম দিকের সাথে মিলে যায়। এর প্রস্থ ১২ পিটি।
- ট্রিপ প্রোগ্রেস বারটি স্ক্রিনের উল্লম্ব স্থানের সাথে গতিশীলভাবে সাড়া দেয়। বারটির নিচের অংশ স্ক্রিনের নিচ থেকে ২১০ পিটি উপরে অবস্থিত। ট্রিপ প্রোগ্রেস বারের উপরের অংশ স্ক্রিনের উপর থেকে কমপক্ষে ১৭০ পিটি উপরে থাকে এবং বারটির সর্বোচ্চ উচ্চতা হলো ৪০০ পিটি।
- If the trip progress bar overlaps with the navigation header or other Navigation UI elements, it appears under those other elements.
প্রম্পট ভিজিবিলিটি এপিআই (পরীক্ষামূলক)
The Prompt Visibility API lets you avoid conflicts between UI elements generated by the Navigation SDK and your own custom UI elements by adding a listener to receive a callback before a Navigation SDK UI element is about to appear and as soon as the element is removed. For more information, including code samples, see the Prompt Visibility API section of the Configure real-time-disruptions page.
Traffic lights and stop signs

সক্রিয় নেভিগেশন চলাকালীন আপনি mapView ট্র্যাফিক লাইট এবং স্টপ সাইন প্রদর্শন চালু করতে পারেন, যা রুট এবং ভ্রমণের কৌশল সম্পর্কে অতিরিক্ত ধারণা দেয়।
ডিফল্টরূপে, iOS-এর নেভিগেশন SDK-তে ট্র্যাফিক লাইট এবং স্টপ সাইন নিষ্ক্রিয় থাকে। এই বৈশিষ্ট্যটি সক্রিয় করতে, প্রতিটি বিকল্পের জন্য GMSMapView সেটিংস আলাদাভাবে কল করুন: showsTrafficLights এবং showsStopSigns ।
সুইফট
mapView.settings.showsTrafficLights = true
mapView.settings.showsStopSigns = true
উদ্দেশ্য-সি
mapView.settings.showsTrafficLights = YES;
mapView.settings.showsStopSigns = YES;
Speedometer control
যখন নেভিগেশন চালু থাকে এবং ভ্রমণ মোড ড্রাইভিং-এ সেট করা থাকে, তখন iOS-এর জন্য নেভিগেশন SDK ম্যাপের নিচের কোণায় একটি গতিসীমা নিয়ন্ত্রক প্রদর্শন করে, যা বর্তমান গতিসীমা দেখায়। যখন চালক গতিসীমা অতিক্রম করেন, তখন নিয়ন্ত্রকটি প্রসারিত হয়ে চালকের বর্তমান গতিসহ একটি দ্বিতীয় স্পিডোমিটার প্রদর্শন করে।
চালক যখন গতিসীমা একটি নির্দিষ্ট পরিমাণে অতিক্রম করেন, তখন স্পিডোমিটার ডিসপ্লের ফরম্যাটিং পরিবর্তন করার জন্য আপনি অ্যালার্ট লেভেল সেট করতে পারেন। উদাহরণস্বরূপ, আপনি নির্দিষ্ট করতে পারেন যে চালক গতিসীমা ৫ মাইল প্রতি ঘণ্টা (mph) অতিক্রম করলে বর্তমান গতি লাল রঙের টেক্সটে প্রদর্শিত হবে এবং গতিসীমা ১০ মাইল প্রতি ঘণ্টা (mph) অতিক্রম করলে লাল ব্যাকগ্রাউন্ডে প্রদর্শিত হবে।
গতিসীমা নিয়ন্ত্রণ প্রদর্শন করতে, GMSUISettings এর shouldDisplaySpeedometer প্রপার্টিটি true তে সেট করুন। গতিসীমা নিয়ন্ত্রণের প্রদর্শন বন্ধ করতে, shouldDisplaySpeedometer false তে সেট করুন।
সুইফট
mapView.settings.shouldDisplaySpeedometer = true
উদ্দেশ্য-সি
mapView.settings.shouldDisplaySpeedometer = YES;
স্পিডোমিটারের জন্য অ্যালার্ট সেট করার বিষয়ে আরও তথ্যের জন্য, ‘স্পিডোমিটার অ্যালার্ট কনফিগার করুন’ দেখুন।
Destination markers
আপনি GMSUISettings এর showsDestinationMarkers প্রপার্টি সেট করে একটি নির্দিষ্ট রুটের জন্য গন্তব্য চিহ্নিতকারীগুলো দেখাতে বা লুকাতে পারেন। নিচের উদাহরণটিতে গন্তব্য চিহ্নিতকারীগুলো বন্ধ করা দেখানো হয়েছে।
সুইফট
mapView.settings.showsDestinationMarkers = false
উদ্দেশ্য-সি
mapView.settings.showsDestinationMarkers = NO;
Map experience features
নেভিগেশন এসডিকে আপনাকে আপনার ব্যবহারকারীদের জন্য নেভিগেশন অভিজ্ঞতায় আরও কাস্টমাইজেশন করার সুযোগ দেয়। আপনার ইনস্ট্যান্সে করা পরিবর্তনগুলো ব্যবহারকারীর পরবর্তী অ্যাপ আপডেটের সময় প্রতিফলিত হয়।
Destination highlighting and entrances

যখন একটি placeID দিয়ে কোনো গন্তব্য তৈরি করা হয়, তখন গন্তব্য ভবনটি হাইলাইট করা হবে এবং সম্ভব হলে একটি প্রবেশ আইকন দেখানো হবে। এই দৃশ্যমান সংকেতগুলো ব্যবহারকারীদের তাদের উদ্দিষ্ট গন্তব্য শনাক্ত করতে এবং সেখানে পৌঁছাতে সাহায্য করে।
placeID সহ একটি গন্তব্য তৈরি করতে, GMSNavigationWaypoint ইনিশিয়ালাইজারগুলোর মধ্যে এমন একটি ব্যবহার করুন যা placeID গ্রহণ করে। উদাহরণস্বরূপ, 'Navigate a route' টিউটোরিয়ালে তৈরি করা গন্তব্যগুলোতে, উপলব্ধ থাকলে, গন্তব্য হাইলাইটিং এবং প্রবেশপথের লেবেল অন্তর্ভুক্ত থাকে।
3D building display during navigation

নেভিগেশনের সময় ডিফল্টরূপে 3D বিল্ডিং প্রদর্শিত হয়। এই বৈশিষ্ট্যটি নিষ্ক্রিয় করতে, buildingsEnabled- কে false (সুইফট) বা NO (অবজেক্টিভ-সি) সেট করুন।
Disable default map gestures
আপনি GMSUISettings ক্লাসের প্রোপার্টিগুলো সেট করার মাধ্যমে ম্যাপের ডিফল্ট জেসচারগুলো নিষ্ক্রিয় করতে পারেন, যা GMSMapView এর একটি প্রোপার্টি হিসেবে উপলব্ধ। নিম্নলিখিত জেসচারগুলো প্রোগ্রাম্যাটিকভাবে সক্রিয় এবং নিষ্ক্রিয় করা যায়। মনে রাখবেন যে, জেসচার নিষ্ক্রিয় করলে ক্যামেরা সেটিংসে প্রোগ্রাম্যাটিক অ্যাক্সেস সীমিত হবে না।
-
scrollGestures— স্ক্রল জেসচার চালু বা বন্ধ থাকবে কিনা তা নিয়ন্ত্রণ করে। এটি চালু থাকলে, ব্যবহারকারীরা ক্যামেরা প্যান করার জন্য সোয়াইপ করতে পারবেন। -
zoomGestures— জুম জেসচার চালু বা বন্ধ থাকবে কিনা তা নিয়ন্ত্রণ করে। এটি চালু থাকলে, ব্যবহারকারীরা ক্যামেরা জুম করার জন্য ডাবল ট্যাপ, দুই আঙুলের ট্যাপ বা পিঞ্চ করতে পারবেন। উল্লেখ্য যে,scrollGesturesচালু থাকা অবস্থায় ডাবল ট্যাপ বা পিঞ্চ করলে ক্যামেরাটি নির্দিষ্ট পয়েন্টে প্যান হতে পারে। -
tiltGestures— টিল্ট জেসচার চালু বা বন্ধ থাকবে কিনা তা নিয়ন্ত্রণ করে। এটি চালু থাকলে, ব্যবহারকারীরা দুটি আঙুল দিয়ে উল্লম্বভাবে নিচে বা উপরে সোয়াইপ করে ক্যামেরা টিল্ট করতে পারবেন। -
rotateGestures— controls whether rotate gestures are enabled or disabled. If enabled, users may use a two-finger rotate gesture to rotate the camera.
এই উদাহরণে, প্যান এবং জুম উভয় জেসচারই নিষ্ক্রিয় করা হয়েছে।
সুইফট
mapView.settings.scrollGestures = false
mapView.settings.zoomGestures = false
উদ্দেশ্য-সি
mapView.settings.scrollGestures = NO;
mapView.settings.zoomGestures = NO;
Position controls and UI elements
You can position controls and other UI elements relative to the position of the navigation header and footer, by using the following properties:
-
navigationHeaderLayoutGuide -
navigationFooterLayoutGuide -
bottomTrailingButtonsLayoutGuide
The following code example shows using the layout guides to position a pair of labels in the map view:
সুইফট
/* Add a label to the top left, positioned below the header. */
let topLabel = UILabel()
topLabel.text = "Top Left"
mapView.addSubview(topLabel)
topLabel.translatesAutoresizingMaskIntoConstraints = false
topLabel.topAnchor.constraint(equalTo: mapView.navigationHeaderLayoutGuide.bottomAnchor).isActive = true
topLabel.leadingAnchor.constraint(equalTo: mapView.leadingAnchor).isActive = true
/* Add a label to the bottom right, positioned above the footer. */
let bottomLabel = UILabel()
bottomLabel.text = "Bottom Right"
mapView.addSubview(bottomLabel)
bottomLabel.translatesAutoresizingMaskIntoConstraints = false
bottomLabel.bottomAnchor.constraint(equalTo: mapView.navigationFooterLayoutGuide.topAnchor).isActive = true
bottomLabel.trailingAnchor.constraint(equalTo: mapView.trailingAnchor).isActive = true
উদ্দেশ্য-সি
/* Add a label to the top left, positioned below the header. */
UILabel *topLabel = [[UILabel alloc] init];
topLabel.text = @"Top Left";
[view addSubview:topLabel];
topLabel.translatesAutoresizingMaskIntoConstraints = NO;
[topLabel.topAnchor
constraintEqualToAnchor:mapView.navigationHeaderLayoutGuide.bottomAnchor].active = YES;
[topLabel.leadingAnchor constraintEqualToAnchor:mapView.leadingAnchor].active = YES;
/* Add a label to the bottom right, positioned above the footer. */
UILabel *bottomLabel = [[UILabel alloc] init];
bottomLabel.text = @"Bottom Right";
[view addSubview:bottomLabel];
bottomLabel.translatesAutoresizingMaskIntoConstraints = NO;
[bottomLabel.bottomAnchor
constraintEqualToAnchor:mapView.navigationFooterLayoutGuide.topAnchor].active = YES;
[bottomLabel.trailingAnchor constraintEqualToAnchor:mapView.trailingAnchor].active = YES;
For an example of how to use a bottomTrailingButtonsLayoutGuide , to position the real-time disruptions reporting button, see Configure real-time disruptions .
Hide alternate routes
When the user interface becomes cluttered with too much information, you can reduce clutter by displaying fewer alternate routes than the default (two), or by displaying no alternate routes at all. You can configure this option before you fetch the routes by configuring GMSNavigationRoutingOptions , and setting the alternateRoutesStrategy with one of the following enumeration values:
| গণনার মান | বর্ণনা |
|---|---|
| GMSNavigationAlternateRoutesStrategyAll | Default. Displays up to two alternate routes. |
| GMSNavigationAlternateRoutesStrategyOne | Displays one alternate route (if one is available). |
| GMSNavigationAlternateRoutesStrategyNone | Hides alternate routes. |
উদাহরণ
The following code example demonstrates how to hide alternate routes altogether.
সুইফট
let routingOptions = GMSNavigationRoutingOptions(alternateRoutesStrategy: .none)
navigator?.setDestinations(destinations,
routingOptions: routingOptions) { routeStatus in
...
}
উদ্দেশ্য-সি
GMSNavigationRoutingOptions *routingOptions = [[GMSNavigationRoutingOptions alloc] initWithAlternateRoutesStrategy:GMSNavigationAlternateRoutesStrategyNone];
[navigator setDestinations:destinations
routingOptions:routingOptions
callback:^(GMSRouteStatus routeStatus){...}];