إعداد خريطة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختيار النظام الأساسي:
نظام التشغيل
Android
iOS
لإعداد خريطة لمتابعة رحلة في نظام iOS، أكمل الخطوات التالية:
إعداد عرض الخريطة
التعامل مع أحداث الخريطة
ملاحظة: بعد تهيئة عرض الخريطة، يمكنك تخصيص
الخريطة. لمزيد من التفاصيل، يُرجى الاطّلاع على مقالة منح الخريطة مظهرًا .
الخطوة 1: تهيئة عرض الخريطة
لمتابعة رحلة، يجب عليك تهيئة عرض الخريطة.
يوضّح المثال التالي كيفية بدء GMTCMapView
.
Swift
/*
* MapViewController.swift
*/
class ViewController : UIViewController , GMTCMapViewDelegate {
private var rideSharingMap : GMTCMapView ?
override func viewDidLoad () {
super . viewDidLoad ()
self . rideSharingMap = GMTCMapView ( frame : UIScreen . main . bounds )
self . rideSharingMap . delegate = self
self . rideSharingMap ?. settings . myLocationButton = true
self . view . addSubview ( self . rideSharingMap !)
...
}
}
Objective-C
/*
* MapViewController.h
*/
@interface MapViewController : UIViewController<GMTCMapViewDelegate>
...
@end
/*
* MapViewController.m
*/
@implementation MapViewController
- ( void ) viewDidLoad {
[ super viewDidLoad ];
...
self . mapView = [[ GMTCMapView alloc ] initWithFrame : CGRectZero ];
self . mapView . settings . myLocationButton = YES ;
self . mapView . delegate = self ;
...
}
...
@end
الخطوة 2: معالجة أحداث عرض الخريطة
الآن وبعد أن قمت بتهيئة عرض الخريطة، إليك كيفية تنفيذ مفوَّض
التعامل مع التغييرات في أحداث عرض الخريطة أثناء تقدم المركبة في رحلتها.
Swift
func mapViewDidInitialize ( _ mapview : GMTCMapView ) {
// Handle the update to the state of the map view to browsing.
}
func mapView ( _ mapView : GMSMapView , didTapConsumerMarker mapMarker : GMSMarker , markerType : GMTCMapViewMarkerType ) - > Bool {
// Handle the mapView marker was tapped.
}
Objective-C
/*
* MapViewController.m
*/
#pragma mark - GMTCMapViewDelegate implementation
// Handle state update of map view.
- ( void ) mapViewDidInitializeCustomerState: ( GMTCMapView * ) mapview {
// Handle the update to the state of the map view to browsing.
}
- ( void ) mapView: ( GMSMapView * ) mapView
didTapConsumerMarker :( nonnull GMSMarker * ) mapMarker
markerType :( GMTCMapViewMarkerType ) markerType {
// Handle the mapView marker was tapped.
}
الخطوات التالية
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0 . للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers . إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-09-12 (حسب التوقيت العالمي المتفَّق عليه)
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"لا يحتوي على المعلومات التي أحتاج إليها."
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"الخطوات معقدة للغاية / كثيرة جدًا."
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"المحتوى قديم."
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"ثمة مشكلة في الترجمة."
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"مشكلة في العيّنات / التعليمات البرمجية"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"غير ذلك"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"يسهُل فهم المحتوى."
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"ساعَدني المحتوى في حلّ مشكلتي."
},{
"type": "thumb-up",
"id": "otherUp",
"label":"غير ذلك"
}]
{"lastModified": "\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0623\u062e\u064a\u0631: 2024-09-12 (\u062d\u0633\u0628 \u0627\u0644\u062a\u0648\u0642\u064a\u062a \u0627\u0644\u0639\u0627\u0644\u0645\u064a \u0627\u0644\u0645\u062a\u0641\u0651\u064e\u0642 \u0639\u0644\u064a\u0647)"}
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-09-12 (حسب التوقيت العالمي المتفَّق عليه)"]]