تستخدم حزمة تطوير البرامج بالاستناد إلى بيانات "خرائط Google" لنظام التشغيل iOS أنظمة الإحداثيات التالية:
قيم خطوط الطول والعرض، التي تشير إلى نقطة على
بشكل فريد. (تستخدم Google
الجيوديسية العالمية
WGS84 العادي)
الإحداثيات العالمية التي تشير إلى نقطة على الخريطة بشكل فريد
إحداثيات Pixel، والتي تشير إلى بكسل معين على الخريطة عند
مستوى تكبير/تصغير محدد.
إحداثيات المربع، التي تشير إلى مربع معين على الخريطة عند
مستوى تكبير/تصغير محدد.
الإحداثيات العالمية
عندما تحتاج واجهة برمجة التطبيقات إلى ترجمة أحد المواقع في العالم إلى أحد المواقع على
خريطة، فإنها تترجم أولاً قيم خطوط الطول والعرض إلى
العالمي. تستخدم واجهة برمجة التطبيقات
مورِّد
العرض لتنفيذ هذه الترجمة.
تسهيل عملية حساب إحداثيات البكسل (انظر أدناه)
نفترض أن الخريطة عند مستوى التكبير/التصغير 0 عبارة عن مربع واحد لحجم الإطار الأساسي.
ثم نحدد إحداثيات العالم بالنسبة إلى إحداثيات البكسل عند التكبير
المستوى 0، باستخدام التوقع لتحويل خطوط الطول والعرض إلى
لمواضع البكسل على هذا الجزء الأساسي. إحداثيات العالم هذه عائمة
يتم قياسها من أصل إسقاط الخريطة حتى
لموقع محدد. تجدر الإشارة إلى أنّه بما أنّ هذه القيمة هي قيمة نقطة عائمة،
فقد تكون أكثر دقة من الدقة الحالية لصورة الخريطة
التي يتم عرضها. تكون الإحداثيات العالمية مستقلة عن مستوى التكبير/التصغير الحالي،
أو بعبارةٍ أخرى.
يتم قياس الإحداثيات العالمية في "خرائط Google" من خلال مطار "ميركاتور".
أصل الإسقاط (الزاوية الشمالية الغربية من الخريطة عند 180 درجة)
خط الطول وخط العرض 85 درجة تقريبًا) وتزيد في
اتجاه x باتجاه الشرق (اليمين) وزيادة في
اتجاه y باتجاه الجنوب (لأسفل). نظرًا لأن
يبلغ حجم مربّع خرائط Google الأساسي 256 × 256 بكسل، وهو قابل للاستخدام
مساحة الإحداثيات العالمية هي {0-256}, {0-256}.
لاحظ أن إسقاط ماركتور له حدود
العرض طوليًا لكن ارتفاعًا لانهائيًا ثنائي العرض. قطعنا
الخريطة الأساسية باستخدام إسقاط ماركتور في حوالي
+/- 85 درجة لجعل شكل الخريطة الناتج مربعًا، مما يسمح
منطقًا أسهل لاختيار المربعات. لاحظ أن التوقع قد ينتج
الإحداثيات العالمية خارج المساحة الإحداثيات القابلة للاستخدام على الخريطة الأساسية
إذا كنت ترسم بالقرب من الأعمدة، على سبيل المثال.
إحداثيات البكسل
تشير إحداثيات Pixel إلى بكسل معيّن على الخريطة عند
مستوى تكبير/تصغير محدد، في حين أن إحداثيات العالم تعكس المواقع المطلقة على
توقع معين. يتم حساب إحداثيات البكسل باستخدام ما يلي
المعادلة:
pixelCoordinate = worldCoordinate * 2zoomLevel
من المعادلة أعلاه، لاحظ أن كل مستوى تكبير/تصغير متزايد
أكبر بمقدار ضعف في كلّ من x وy
الاتجاهات. وبالتالي، ينتج عن كل مستوى تكبير/تصغير أعلى دقة أربعة
مرات أعلى من المستوى السابق. على سبيل المثال، في مستوى التكبير/التصغير 1،
تتكون الخريطة من 4 مربعات بحجم 256×256 بكسل، مما ينتج عنه مساحة بكسل
من 512×512. في مستوى التكبير/التصغير 19، كل x وy بكسل
على الخريطة باستخدام قيمة بين
0 و256 * 219.
ولأننا استندنا إلى إحداثيات العالم على حجم مربع الخريطة،
تأثير الجزء الصحيح لإحداثيات البكسل في تحديد البكسل الدقيق.
في هذا الموقع في مستوى التكبير/التصغير الحالي. لاحظ أنه بالنسبة لمستوى التكبير/التصغير 0،
إحداثيات البكسل تساوي إحداثيات العالم.
لدينا الآن طريقة للإشارة بدقة إلى كل موقع على الخريطة،
على كل مستوى من مستويات التكبير أو التصغير. تُنشئ حزمة تطوير البرامج بالاستناد إلى بيانات "خرائط Google" لأجهزة iOS إطار عرض.
بناءً على مركز مستوى تكبير/تصغير الخريطة (كسمة LatLng)
حجم عنصر DOM الذي يحتوي على
ويحول مربع الإحاطة هذا إلى إحداثيات بكسل. تحدّد واجهة برمجة التطبيقات بعد ذلك
ولكن منطقيًا جميع مربعات الخرائط التي تقع ضمن حدود البكسل المحددة. كل من
تتم الإشارة إلى مربعات الخرائط هذه باستخدام
إحداثيات المربعات التي تبسط إلى حد كبير عرض الخريطة
الصور.
إحداثيات المربّعات
لا يمكن لواجهة برمجة التطبيقات تحميل جميع صور الخريطة في وقت واحد لمستويات التكبير الأعلى.
بدلاً من ذلك، تقسّم واجهة برمجة التطبيقات الصور على كل مستوى من مستويات التكبير أو التصغير
في مجموعة من مربعات الخرائط، والتي يتم ترتيبها منطقيًا بترتيب
التطبيق. عندما يتم تمرير خريطة إلى موقع جديد أو إلى موقع
مستوى التكبير أو التصغير، تحدِّد واجهة برمجة التطبيقات المربّعات المطلوبة
باستخدام إحداثيات البكسل، وترجمة هذه القيم إلى مجموعة
من المربعات لاستردادها. يتم تعيين إحداثيات التجانب هذه باستخدام
مخطط يجعل من السهل منطقيًا تحديد المربع الذي يحتوي على
الصور لأي نقطة معينة.
يتم ترقيم المربعات في خرائط Google من الأصل نفسه مثل ذلك
لوحدات البكسل. لتنفيذ Google لإسقاط ماركتور،
يقع مربّع المصدر دائمًا في الزاوية الشمالية الغربية
الخريطة، مع زيادة قيم x من الغرب إلى
الشرق وتزداد القيمتان y من الشمال إلى الجنوب. بلاط
تتم فهرستها باستخدام إحداثيات x,y من هذا المصدر. بالنسبة
في مستوى التكبير/التصغير 2 مثلاً، عندما تنقسم الأرض إلى 16 مربعًا،
ويمكن الإشارة إلى كل مربّع من خلال زوج x,y فريد:
لاحظ أنه من خلال قسمة إحداثيات البكسل على حجم المربع (256)،
مع أخذ الأجزاء الصحيحة للناتج، فإنك تحصل عليها كحاصل ضرب
إحداثيات المربع في مستوى التكبير الحالي.
مثال
يعرض المثال التالي إحداثيات مدينة شيكاغو، إلينوي:
قيم خطوط الطول/العرض وإحداثيات العالم وإحداثيات البكسل والمربع
الإحداثيات. استخدم التحكم في التكبير/التصغير لمشاهدة قيم الإحداثيات بمختلف أنواع
ومستويات التكبير أو التصغير.
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Maps SDK for iOS utilizes four coordinate systems: latitude/longitude, world, pixel, and tile coordinates, to pinpoint locations on the map.\u003c/p\u003e\n"],["\u003cp\u003eWorld coordinates, derived from latitude/longitude using the Mercator projection, represent points on the map and are independent of zoom level.\u003c/p\u003e\n"],["\u003cp\u003ePixel coordinates denote specific pixels on the map at a given zoom level and are calculated by multiplying world coordinates by 2 raised to the power of the zoom level.\u003c/p\u003e\n"],["\u003cp\u003eTile coordinates are used to efficiently load map imagery by dividing the map into a grid of tiles, with each tile assigned a unique x,y coordinate based on its position.\u003c/p\u003e\n"],["\u003cp\u003eThe API utilizes these coordinate systems to translate between real-world locations and their corresponding representations on the map, enabling accurate display and navigation.\u003c/p\u003e\n"]]],["The Maps SDK for iOS utilizes latitude/longitude, world, pixel, and tile coordinate systems. World coordinates, based on the Mercator projection, convert latitude/longitude to map locations, independent of zoom. Pixel coordinates reference specific pixels at a zoom level, calculated by multiplying world coordinates by 2 to the power of the zoom level. Tile coordinates, derived from pixel coordinates, divide the map into tiles, enabling the API to retrieve and display only necessary imagery at various zoom levels. Each coordinate type is measured from the northwest corner.\n"],null,["Select platform: [Android](/maps/documentation/android-sdk/coordinates \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/coordinates \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/coordinates \"View this page for the JavaScript platform docs.\")\n\nThe Maps SDK for iOS uses the following coordinate systems:\n\n- Latitude and longitude values, which reference a point on the world uniquely. (Google uses the [World Geodetic\n System WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) standard.)\n- World coordinates, which reference a point on the map uniquely.\n- Pixel coordinates, which reference a specific pixel on the map at a specific zoom level.\n- Tile coordinates, which reference a specific tile on the map at a specific zoom level.\n\nWorld coordinates\n\nWhenever the API needs to translate a location in the world to a location on\na map, it first translates latitude and longitude values into a\n*world* coordinate. The API uses the\n[Mercator\nprojection](https://en.wikipedia.org/wiki/Mercator_projection) to perform this translation.\n\nFor convenience in the calculation of pixel coordinates (see below)\nwe assume a map at zoom level 0 is a single tile of the base tile size.\nWe then define world coordinates relative to pixel coordinates at zoom\nlevel 0, using the projection to convert latitudes and longitudes to\npixel positions on this base tile. This world coordinate is a floating\npoint value measured from the origin of the map projection to the\nspecific location. Note that since this value is a floating point value,\nit may be much more precise than the current resolution of the map image\nbeing shown. A world coordinate is independent of the current zoom level,\nin other words.\n\nWorld coordinates in Google Maps are measured from the Mercator\nprojection's origin (the northwest corner of the map at 180 degrees\nlongitude and approximately 85 degrees latitude) and increase in\nthe `x` direction towards the east (right) and increase in\nthe `y` direction towards the south (down). Because the\nbasic Mercator Google Maps tile is 256 x 256 pixels, the usable\nworld coordinate space is `{0-256}, {0-256}`.\n\nNote that a Mercator projection has a finite\nwidth longitudinally but an infinite height latitudinally. We cut off\nbase map imagery utilizing the Mercator projection at approximately\n+/- 85 degrees to make the resulting map shape square, which allows\neasier logic for tile selection. Note that a projection may produce\nworld coordinates outside the base map's usable coordinate space\nif you plot very near the poles, for example.\n\nPixel coordinates\n\n*Pixel coordinates* reference a specific pixel on the map at a\nspecific zoom level, whereas world coordinates reflect absolute locations on a\ngiven projection. Pixel coordinates are calculated using the following\nformula: \n\n```scdoc\npixelCoordinate = worldCoordinate * 2zoomLevel\n```\n\nFrom the above equation, note that each increasing zoom level\nis twice as large in both the `x` and `y`\ndirections. Therefore, each higher zoom level results in a resolution four\ntimes higher than the preceding level. For example, at zoom level 1,\nthe map consists of 4 256x256 pixels tiles, resulting in a pixel space\nfrom 512x512. At zoom level 19, each `x` and `y` pixel\non the map can be referenced using a value between\n0 and 256 \\* 2^19^.\n\nBecause we based world coordinates on the map's tile size, a\npixel coordinate's integer part has the effect of identifying the exact pixel\nat that location in the current zoom level. Note that for zoom level 0, the\npixel coordinates are equal to the world coordinates.\n\nWe now have a way to accurately denote each location on the map,\nat each zoom level. The Maps SDK for iOS constructs a viewport\ngiven the zoom level center of the map (as a `LatLng`) and the\nsize of the containing DOM element, and\ntranslates this bounding box into pixel coordinates. The API then determines\nlogically all map tiles which lie within the given pixel bounds. Each of\nthese map tiles are referenced using [tile coordinates](#tile-coordinates) which greatly simplify the displaying of map\nimagery.\n\nTile coordinates\n\nThe API cannot load all the map imagery at once for the higher zoom levels.\nInstead, the API breaks up the imagery at each zoom level\ninto a set of map tiles, which are logically arranged in an order which the\napplication understands. When a map scrolls to a new location, or to a new\nzoom level, the API determines which tiles are needed\nusing pixel coordinates, and translates those values into a set\nof tiles to retrieve. These tile coordinates are assigned using\na scheme which makes it logically easy to determine which tile contains\nthe imagery for any given point.\n\nTiles in Google Maps are numbered from the same origin as that\nfor pixels. For Google's implementation of the Mercator projection, the\norigin tile is always at the northwest corner\nof the map, with `x` values increasing from west to\neast and `y` values increasing from north to south. Tiles\nare indexed using `x,y` coordinates from that origin. For\nexample, at zoom level 2, when the earth is divided up into 16 tiles,\neach tile can be referenced by a unique `x,y` pair:\n\nNote that by dividing the pixel coordinates by the tile size (256) and\ntaking the integer parts of the result, you produce as a by-product\nthe tile coordinate at the current zoom level.\n\nExample\n\nThe following example displays coordinates for Chicago, IL:\nlatitude/longitude values, world coordinates, pixel coordinates, and tile\ncoordinates. Use the zoom control to see the coordinate values at various\nzoom levels.\n\nTo see how the coordinates were calculated,\n[view\nthe code](/maps/documentation/javascript/examples/map-coordinates)."]]