স্পিডোমিটার সতর্কতা কনফিগার করুন

যখন নেভিগেশন সক্ষম করা থাকে এবং ভ্রমণের মোডটি ড্রাইভিং-এ সেট করা থাকে, তখন iOS-এর জন্য নেভিগেশন SDK মানচিত্রের নীচের বাম কোণে একটি গতি সীমা নিয়ন্ত্রণ প্রদর্শন করে যা বর্তমান গতি সীমা দেখায়। যদি একজন চালক গতি সীমা অতিক্রম করে, তবে গতি সীমা প্রদর্শনের পাশে একটি স্পিডোমিটার প্রদর্শন করতে নিয়ন্ত্রণটি প্রসারিত হয় এবং গতি একটি নির্দিষ্ট থ্রেশহোল্ডে পৌঁছালে সতর্কতা ট্রিগার করে।

ডিফল্টরূপে, ড্রাইভার যখন গতিসীমা 5 mph (বা 10 kph) অতিক্রম করে তখন নেভিগেশন SDK একটি ছোট গতির সতর্কতা ট্রিগার করে এবং স্পিডোমিটার পাঠ্যের রঙ লাল করে পরিবর্তন করে। যখন চালক 10 mph (বা 20 kph) গতিসীমা অতিক্রম করে তখন এটি একটি বড় গতির সতর্কতা ট্রিগার করে এবং স্পিডোমিটারের পটভূমির রঙ লাল করে।

আপনি সতর্কতা ট্রিগার করার জন্য থ্রেশহোল্ড এবং স্পিডোমিটার প্রদর্শন করা পাঠ্য এবং পটভূমির রঙ উভয়ই কাস্টমাইজ করতে পারেন। ড্রাইভারের গতির তথ্য উপলব্ধ করতে আপনি নেভিগেশন SDK ব্যবহার করতে পারেন। উদাহরণস্বরূপ, আপনি রাইডশেয়ার অপারেটরদের কাছে গতির তথ্য উপলব্ধ করতে পারেন যাতে তারা তাদের ড্রাইভারদের গতি সীমা মেনে চলতে এবং নিরাপত্তা উন্নত করতে উৎসাহিত করতে পারে।

গতির সতর্কতার জন্য থ্রেশহোল্ড কাস্টমাইজ করা

আপনি বর্তমান গতির গতিসীমার উপর শতাংশ হিসাবে ছোট এবং বড় উভয় গতির সতর্কতার জন্য গতি সতর্কতা থ্রেশহোল্ড কাস্টমাইজ করতে পারেন। ম্যাপ সতর্কতা প্রদর্শন করার আগে আপনি কতক্ষণ থ্রেশহোল্ড অতিক্রম করেছেন তাও উল্লেখ করতে পারেন।

নিম্নলিখিত কোড উদাহরণটি একটি ছোট গতির সতর্কতার জন্য থ্রেশহোল্ডকে গতি সীমার উপরে পাঁচ শতাংশে এবং একটি বড় গতির সতর্কতার জন্য থ্রেশহোল্ড গতি সীমার উপরে 10 শতাংশে সেট করে৷ এটি সুনির্দিষ্ট করে যে পাঁচ সেকেন্ডের জন্য একটি সতর্কতা থ্রেশহোল্ড অতিক্রম করার পরে মানচিত্রটি একটি সতর্কতা প্রদর্শন করে৷

সুইফট

let minorSpeedAlertThresholdPercentage: CGFloat = 0.05 let
majorSpeedAlertThresholdPercentage: CGFloat = 0.1 let
severityUpgradeDurationSeconds: TimeInterval = 5

// Configure SpeedAlertOptions let mutableSpeedAlertOptions:
GMSNavigationMutableSpeedAlertOptions = GMSNavigationMutableSpeedAlertOptions()
 mutableSpeedAlertOptions.setSpeedAlertThresholdPercentage(minorSpeedAlertThresholdPercentage,
for: .minor)
mutableSpeedAlertOptions.setSpeedAlertThresholdPercentage(majorSpeedAlertThresholdPercentage,
for: .major) mutableSpeedAlertOptions.severityUpgradeDurationSeconds =
severityUpgradeDurationSeconds

// Set SpeedAlertOptions to Navigator. mapView.navigator?.speedAlertOptions =
mutableSpeedAlertOptions; mapView.navigator?.add(self); // Only needed if
listening to the delegate events.

উদ্দেশ্য গ

static const CGFloat minorSpeedAlertThresholdPercentage = 0.05; static const
CGFloat majorSpeedAlertThresholdPercentage = 0.1; static const NSTimeInterval
severityUpgradeDurationSeconds = 5;

// Configure SpeedAlertOptions GMSNavigationMutableSpeedAlertOptions
*mutableSpeedAlertOptions = [[GMSNavigationMutableSpeedAlertOptions alloc]
init]; [mutableSpeedAlertOptions setSpeedAlertThresholdPercentage:
minorSpeedAlertThresholdPercentage
forSpeedAlertSeverity:GMSNavigationSpeedAlertSeverityMinor];
[mutableSpeedAlertOptions
setSpeedAlertThresholdPercentage:majorSpeedAlertThresholdPercentage
forSpeedAlertSeverity:GMSNavigationSpeedAlertSeverityMajor];
[mutableSpeedAlertOptions
setSeverityUpgradeDurationSeconds:severityUpgradeDurationSeconds];

// Set SpeedAlertOptions to Navigator. mapView.navigator.speedAlertOptions =
mutableSpeedAlertOptions; [mapView.navigator addListener:self]; // Only needed
if listening to the delegate events.

স্পিডোমিটার কীভাবে গতির সতর্কতা প্রদর্শন করে তা কাস্টমাইজ করা

আপনি প্রতিটি সতর্কতা স্তরের জন্য স্পিডোমিটার প্রদর্শনের রং কাস্টমাইজ করতে পারেন।

নিচের টেবিলটি GMSNavigationSpeedometerUIOptions ক্লাসে গতির সতর্কতার জন্য ডিফল্ট রং দেখায়:

উপাদান রঙ
MinorSpeedAlertBackgroundColorDayMode 0xffffff(সাদা)
MinorSpeedAlertBackground ColorNightMode 0x000000
MinorSpeedAlertTextColorDayMode 0xd93025
MinorSpeedAlertTextColorNightMode 0xd93025
MajorSpeedAlertBackgroundColorDayMode 0xd93025
মেজরস্পিড অ্যালার্ট ব্যাকগ্রাউন্ড কালার নাইটমোড 0xd93025
MajorSpeedAlertTextColorDayMode 0xffffff(সাদা)
MajorSpeedAlertTextColorNightMode 0xffffff(সাদা)

আপনি ছোট এবং বড় উভয় গতির সতর্কতার জন্য স্পিডোমিটারের পাঠ্য এবং পটভূমির রঙ নির্দিষ্ট করতে পারেন:

সুইফট

let mutableSpeedometerUIOptions: GMSNavigationMutableSpeedometerUIOptions =
GMSNavigationMutableSpeedometerUIOptions()
mutableSpeedometerUIOptions.setTextColor(minorSpeedAlertTextColor, for: .minor,
lightingMode: .normal)
mutableSpeedometerUIOptions.setTextColor(majorSpeedAlertTextColor, for: .major,
lightingMode: .normal)
mutableSpeedometerUIOptions.setBackgroundColor(minorSpeedAlertNightModeBackgroundColor,
for: .minor, lightingMode: .lowLight)
mutableSpeedometerUIOptions.setBackgroundColor(majorSpeedAlertDayModeBackgroundColor,
for: .major, lightingMode: .normal)

mapView.settings.speedometerUIOptions = mutableSpeedometerUIOptions

উদ্দেশ্য গ

GMSNavigationMutableSpeedometerUIOptions *mutableSpeedometerUIOptions =
[[GMSNavigationMutableSpeedometerUIOptions alloc] init];
[mutableSpeedometerUIOptions setTextColor: minorSpeedAlertTextColor
forSpeedAlertSeverity: GMSNavigationSpeedAlertSeverityMinor lightingMode:
GMSNavigationLightingModeNormal]; [mutableSpeedometerUIOptions setTextColor:
majorSpeedAlertTextColor forSpeedAlertSeverity:
GMSNavigationSpeedAlertSeverityMajor lightingMode:
GMSNavigationLightingModeNormal]; [mutableSpeedometerUIOptions
setBackgroundColor: minorSpeedAlertNightModeBackgroundColor
forSpeedAlertSeverity: GMSNavigationSpeedAlertSeverityMinor lightingMode:
GMSNavigationLightingModeLowLight]; [mutableSpeedometerUIOptions
setBackgroundColor: majorSpeedAlertDayModeBackgroundColor forSpeedAlertSeverity:
GMSNavigationSpeedAlertSeverityMajor
lightingMode:GMSNavigationLightingModeNormal];

mapView.settings.speedometerUIOptions = mutableSpeedometerUIOptions;

চালকদের কাছ থেকে গতির তথ্য প্রাপ্তি

আপনার অ্যাপ্লিকেশানের যদি ড্রাইভারের গতি সম্পর্কে তথ্য ভাগ করে নেওয়ার প্রয়োজন হয়, তাহলে আপনি ড্রাইভারের গতির তথ্য উপলব্ধ করতে নেভিগেশন SDK ব্যবহার করতে পারেন। এটি রাইডশেয়ার অ্যাপ্লিকেশনগুলির জন্য দরকারী হতে পারে যেখানে কোনও অপারেটর নিরাপত্তার উন্নতির জন্য ড্রাইভারদের দ্বারা অত্যধিক গতি নিরীক্ষণ করতে চাইতে পারে।

উদাহরণস্বরূপ, নিম্নোক্ত উদাহরণটি গতির তথ্য শেয়ার করে যখন গতি গতি সীমার উপরে একটি নির্দিষ্ট শতাংশ হয়:

সুইফট

// Listener method for sharing speed information when the speed exceeds the
speed limit by a specified percentage. #pragma mark GMSNavigatorListener func
navigator(_ navigator : GMSNavigator, didUpdateSpeedingPercentage
percentageAboveLimit : Float) { ... }

উদ্দেশ্য গ

// Listener method listening to speeding feed. #pragma mark
GMSNavigatorListener - (void)navigator:(GMSNavigator *)navigator
didUpdateSpeedingPercentage:(float)percentageAboveLimit { ... }