میتوانید از Places SDK برای iOS و Geocoding API با Maps SDK برای iOS برای جستجوی مناطق و دریافت اطلاعات بیشتر درباره مکانها استفاده کنید. Places SDK برای iOS و Geocoding API جایگزین های قدرتمند و پایداری برای به دست آوردن شناسه مکان هستند. اگر قبلاً از شناسههای مکان استفاده میکنید، میتوانید از آن شناسهها با سبکهای مبتنی بر داده برای مرزها استفاده مجدد کنید.
به روشهای زیر مکانها و کدگذاری جغرافیایی را به Maps SDK برای برنامههای iOS اضافه کنید:
Places SDK برای iOS اطلاعات مکانهایی را که از درخواستهای HTTP استفاده میکنند، برمیگرداند.
کلاس CLGeocoder می تواند ژئوکد را به صورت پویا از ورودی کاربر معکوس کند.
Geocoding API به شما امکان می دهد آدرس های استاتیک و شناخته شده را ژئوکد کنید.
از Places API استفاده کنید
Places API Text Search اطلاعاتی درباره مجموعهای از مکانها بر اساس یک رشته برمیگرداند - برای مثال «پیتزا در نیویورک» یا «فروشگاههای کفش در نزدیکی اتاوا» یا «خیابان اصلی ۱۲۳». این سرویس با فهرستی از مکانهای منطبق با رشته متن و هرگونه سوگیری مکان تنظیم شده پاسخ میدهد.
سرویس تکمیل خودکار مکانها روشی مناسب برای امکان جستجوی مناطق به کاربران شما ارائه میدهد. برای نمایش نتایج در منطقه تعریف شده، locationRestriction در GMSAutocompleteFilter تنظیم کنید.
جزئیات مکان را برای یک منطقه دریافت کنید
دادههای جزئیات مکان برای یک منطقه نیز مؤثر است. به عنوان مثال، شما می توانید:
شناسههای مکان مرزی را بر اساس نام مکانها جستجو کنید.
درگاه دید را برای بزرگنمایی به یک مرز دریافت کنید.
نوع ویژگی برای مرز (به عنوان مثال محل) را دریافت کنید.
آدرس قالببندیشده را دریافت کنید که به «نام مکان، ایالت، کشور» در منطقه ایالات متحده تبدیل میشود (به عنوان مثال، «کرکلند، WA، ایالات متحده آمریکا»).
داده های مفید دیگری مانند عکس ها را دریافت کنید.
از Geocoding API استفاده کنید
Geocoding API به شما امکان می دهد آدرس، مختصات طول و عرض جغرافیایی، یا شناسه را به مختصات جغرافیایی تبدیل کنید و بالعکس. کاربردهای زیر به خوبی با استایل داده محور برای مرزها ترکیب می شوند:
از Geocoding برای دریافت نمای یک منطقه استفاده کنید.
برای دریافت شناسه مکان برای مناطق اداری 1-4، محله، یا کد پستی، فیلتر مؤلفه را در تماس Geocoding خود اعمال کنید.
برای یافتن شناسه مکان ها بر اساس مختصات طول و عرض جغرافیایی، از کدگذاری جغرافیایی معکوس استفاده کنید، یا حتی شناسه مکان را برای همه اجزا در یک مکان خاص برگردانید.
مثال زیر از یک آدرس (url-escaped) برای درخواست به API Geocoding استفاده می کند:
برای پیدا کردن شناسههای مکان میتوانید از ژئوکدینگ معکوس استفاده کنید. مثال زیر تابع سرویس Geocoding شناسه های مکان را برای تمام اجزای آدرس در مختصات طول و عرض جغرافیایی مشخص شده برمی گرداند:
برای دریافت مولفه آدرس برای یک یا چند نوع از انواع زیر در محل مشخص شده، از ژئوکدینگ معکوس با فیلتر کردن مؤلفه استفاده کنید:
administrativeArea
country
locality
postalCode
schoolDistrict
مثال زیر نشان می دهد که با استفاده از سرویس Geocoding، محدودیت های مؤلفه با کدگذاری جغرافیایی معکوس برای بازیابی همه اجزای آدرس در مکان مشخص شده برای نوع locality اضافه شده است:
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eYou can search for and get information about regions using the Places SDK for iOS and the Geocoding API with the Maps SDK for iOS.\u003c/p\u003e\n"],["\u003cp\u003eThe Places API Text Search and Autocomplete service enable searching for regions based on text strings and user input.\u003c/p\u003e\n"],["\u003cp\u003ePlace Details provide comprehensive information about regions, including boundary place IDs, viewport for zooming, and feature type.\u003c/p\u003e\n"],["\u003cp\u003eThe Geocoding API facilitates converting addresses and coordinates into geographic coordinates and vice-versa, useful for retrieving viewport, place IDs, and address components.\u003c/p\u003e\n"],["\u003cp\u003eReverse geocoding with the Geocoding API allows finding place IDs based on latitude and longitude coordinates and applying component filtering for specific address types.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/dds-boundaries/dds-use-maps-places-apis \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/dds-boundaries/dds-use-maps-places-apis \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/dds-boundaries/dds-use-maps-places-apis \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nYou can use the Places SDK for iOS and the\nGeocoding API with the Maps SDK for iOS to\nsearch for regions, and get more information about places. The\nPlaces SDK for iOS and Geocoding API\nare powerful and stable alternatives for obtaining [place\nIDs](/maps/documentation/places/ios-sdk/place-id). If you're already using place\nIDs, you can reuse those IDs with data-driven styling for boundaries.\n\nAdd Places and Geocoding to your Maps SDK for iOS apps in the following ways:\n\n- [Places SDK for iOS](/maps/documentation/places/ios-sdk) returns information about places using HTTP requests.\n- [CLGeocoder](https://developer.apple.com/documentation/corelocation/clgeocoder) class can geocode and reverse geocode dynamically from user input.\n- [Geocoding API](/maps/documentation/geocoding) lets you geocode static, known addresses.\n\n| **Note:** The [Places SDK for iOS](/maps/documentation/places/ios-sdk) and Geocoding API must be enabled, and are billed separately from the Maps SDK for iOS.\n\nUse the Places API\n\n- The [Places API Text\n Search](/maps/documentation/places/web-service/text-search) returns\n information about a set of places based on a string --- for example \"pizza in\n New York\" or \"shoe stores near Ottawa\" or \"123 Main Street\". The service\n responds with a list of places matching the text string and any location\n bias that has been set.\n\n- The [Places Autocomplete](/maps/documentation/places/ios-sdk/autocomplete#restrict_results_to_a_specific_region) service provides a convenient\n way to let your users search for regions. To display results within the\n defined region, set `locationRestriction` on\n [`GMSAutocompleteFilter`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSAutocompleteFilter).\n\nGet place details for a region\n\n- The [Place Details](/maps/documentation/places/ios-sdk/place-details) data\n for a region is also effective. For example, you can:\n\n - Search for boundary place IDs based on place names.\n - Get the viewport for zooming to a boundary.\n - Get the feature type for the boundary (for example locality).\n - Get the formatted address, which resolves to \"Place Name, State, Country\" in the United States region (for example, \"Kirkland, WA, USA\").\n - Get other useful data such as photos.\n\nUse the Geocoding API\n\n- The [Geocoding API](/maps/documentation/geocoding) lets you\n convert an address, latitude and longitude coordinates, or place ID into\n geographic coordinates, and vice-versa. The following uses combine well with\n data-driven styling for boundaries:\n\n - Use Geocoding to get the viewport for a region.\n - Apply component filtering to your Geocoding call to get the place IDs for administrative areas 1-4, locality, or postal code.\n - Use reverse geocoding to find place IDs by latitude and longitude coordinates, or even return place IDs for all components in a particular location.\n\n The following example uses an address (url-escaped) to make a request to the\n Geocoding API: \n\n ```html\n https://maps.googleapis.com/maps/api/geocode/json?latlng=41.864182,-87.676930&key=YOUR_API_KEY\n ```\n\n You can use [reverse\n geocoding](/maps/documentation/geocoding/requests-reverse-geocoding) to\n find place IDs. The following example Geocoding service function returns the\n place IDs for all address components at the specified latitude and longitude\n coordinates: \n\n ```html\n https://maps.googleapis.com/maps/api/geocode/json?latlng=41.864182,-87.676930&result_type=locality&key=YOUR_API_KEY\n ```\n\n Use reverse geocoding with component filtering to get the address component\n for one or more of the following types at the specified location:\n - `administrativeArea`\n - `country`\n - `locality`\n - `postalCode`\n - `schoolDistrict`\n\n The following example shows using the Geocoding service, adding component\n restrictions with reverse geocoding to retrieve all address components\n at the specified location for the `locality` type: \n\n ```html\n https://maps.googleapis.com/maps/api/geocode/json?latlng=41.864182,-87.676930&result_type=locality&key=YOUR_API_KEY\n ```"]]