نمای کلی کاشی های دو بعدی
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
توسعه دهندگان منطقه اقتصادی اروپا (EEA). کاشی های نقشه به سادگی تقسیم جهان به یک شبکه نمایه شده است. این به شما امکان می دهد به داده های نقشه به طور موثر و پویا در مقیاس های نقشه برداری متعدد دسترسی داشته باشید و از آنها استفاده کنید. Map Tiles API به شما امکان دسترسی به چندین مجموعه جغرافیایی موضوعی، از جمله تحت نظارت Google را می دهد:
کاشیهای تصویر نقشه راه بر اساس دادههای توپوگرافی برداری با استایل نقشهبرداری Google.
عکاسی ارتوپدی گرفته شده توسط دوربین های ماهواره ای و هوایی که تصاویری از بالا به پایین (نادیر) از زمین ارائه می دهند.
نقشه های کانتور شید.
کاشیهای نقشه دوبعدی همگی دارای ارجاع جغرافیایی و تراز با یکدیگر هستند. آنها بر اساس وسعت جغرافیایی نمای و سطح زوم انتخاب می شوند. سطوح زوم از صفر (برای مشاهده جهان به طور کامل) تا 22 (برای مشاهده خیابان ها و بلوک ها) متغیر است.
تم های نقشه می توانید کاشی های نقشه را برای مضامین نقشه زیر دریافت کنید.
تم نقشه توضیحات نقشه راه جاده ها، ساختمان ها، نقاط دیدنی و مرزهای سیاسی ماهواره تصاویر عکاسی گرفته شده از فضا زمین نقشه کانتور که ویژگی های طبیعی مانند پوشش گیاهی را نشان می دهد
توجه: کاشی های نقشه می توانند از یک یا چند لایه تشکیل شده باشند. به عنوان مثال، یک لایه نقشه راه را می توان در بالای موضوع نقشه ماهواره ای قرار داد. برای اطلاعات بیشتر، فیلدهای اختیاری را ببینید. برای درخواست کاشی های نقشه از Map Tiles API، ابتدا باید یک نشانه جلسه درخواست کنید. نشانه جلسه وضعیت فعلی نقشه و نمای شما را ردیابی می کند. هنگامی که نشانه جلسه خود را تنظیم می کنید، باید مقدار mapType
را برای مطابقت با موضوع نقشه که می خواهید تنظیم کنید. سپس، شما باید نشانه جلسه را در هر یک از درخواست های خود برای Map Tiles API قرار دهید.
درخواست اطلاعات درگاه مشاهده درگاه نمایش، اندازه کادری را که صحنه جهان را قاب می کند، مشخص می کند. اطلاعات Viewport جزئیات مربوط به کاشی های نقشه را که نمایپورت فعلی شما را تشکیل می دهند، درخواست می کند. دلیل درخواست اطلاعات ویوپورت این است که از درخواست تصاویر در سطوح بزرگنمایی که وجود ندارند اجتناب کنید.
به عنوان مثال، بیشتر شهرها دارای تصاویر در سطح زوم 22 هستند، اما اقیانوس نه، زیرا در نهایت مربع های آبی بی خاصیت نمایش داده می شود.
توجه: در پاسخ، انتسابی که باید با نقشه خود نشان دهید و حداکثر سطح بزرگنمایی وجود دارد—بنابراین می توانید یک نوار لغزنده بزرگنمایی بسازید. برای اطلاعات بیشتر، به سیاستهای Map Tiles API مراجعه کنید. درخواست viewport یک درخواست HTTPS GET به شکل زیر است.
curl "https://tile.googleapis.com/tile/v1/viewport ?session=YOUR_SESSION_TOKEN &key=YOUR_API_KEY &zoom=zoom &north=north &south=south &east=east &west=west " درخواست شامل فیلدهای زیر است:
zoom
سطح بزرگنمایی درگاه دید. north
، south
، east
، west
دورترین نقاط شمالی، جنوبی، شرقی و غربی در نما که بر حسب درجه بیان می شود. شمال و جنوب باید در محدوده (90،90-)، شرق و غرب در محدوده (180-، 180-) باشند. برای بیان مرزهای عبور از پادمریدین، غرب می تواند مثبت باشد (مثلاً 170) و شرق می تواند منفی باشد (مثلاً 170-). تمام پارامترها مورد نیاز است. پاسخ های اطلاعات پورت نمایش پاسخ Viewport به شما می گوید که کدام مناطق دارای تصویر هستند و در کدام سطح زوم هستند. پاسخ اطلاعات viewport به شکل زیر است.
{
"copyright" : "Map data ©2023" ,
"maxZoomRects" : [
{
"maxZoom" : 19 ,
"north" : 90 ,
"south" : -90 ,
"east" : 180 ,
"west" : -180
},
{
"maxZoom" : 9 ,
"north" : 90 ,
"south" : -90 ,
"east" : 180 ,
"west" : -180
},
{
"maxZoom" : 14 ,
"north" : 84.375 ,
"south" : -84.375 ,
"east" : 180 ,
"west" : -180
}, ...
]
}
توجه: در این مثال، آرایه maxZoomRects
حاوی اشیاء بیشتری از آنچه نشان داده شده است. بدنه پاسخ شامل فیلدهای زیر است.
copyright
حاوی یک رشته انتساب است که هنگام نمایش نقشه راه و کاشی های ماهواره ای باید روی نقشه خود نمایش دهید. برای اطلاعات بیشتر، به سیاستهای Map Tiles API مراجعه کنید. maxZoomRect
شامل آرایه ای از مستطیل های محدود کننده است که با نمای فعلی همپوشانی دارند. همچنین شامل حداکثر سطح زوم موجود در هر مستطیل است. توابع مختصات کاشی ابزارها (توابع ساده) در اکثر زبان های برنامه نویسی برای تبدیل از جفت طول و عرض جغرافیایی به مختصات کاشی در سطح بزرگنمایی خاص موجود هستند. مثال کد جاوا اسکریپت زیر را در نظر بگیرید که ابتدا از یک latLng
به یک نقطه و سپس از یک نقطه به مختصات کاشی تبدیل می شود.
var TILE_SIZE = 256 ;
function fromLatLngToPoint ( latLng ) {
var mercator = - Math . log ( Math . tan (( 0.25 + latLng . lat () / 360 ) * Math . PI ));
return {
x : TILE_SIZE * ( latLng . lng () / 360 + 0.5 ),
y : TILE_SIZE / 2 * ( 1 + mercator / Math . PI )
};
}
function fromLatLngToTileCoord ( latLng , zoom ) {
var point = fromLatLngToPoint ( latLng );
var scale = Math . pow ( 2 , zoom );
return {
x : Math . floor ( point . x * scale / TILE_SIZE ),
y : Math . floor ( point . y * scale / TILE_SIZE ),
z : zoom
};
}
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eMap Tiles API allows access to various thematic geodatasets like roadmap, orthophotography, and hillshade, dividing the world into an indexed grid for efficient data utilization.\u003c/p\u003e\n"],["\u003cp\u003eMap tiles are available in roadmap, satellite, and terrain themes, and can be overlaid for richer visualizations.\u003c/p\u003e\n"],["\u003cp\u003eA session token is required for accessing Map Tiles API, which tracks the map state and desired theme.\u003c/p\u003e\n"],["\u003cp\u003eViewport information requests help determine available zoom levels and imagery for a specific area to avoid requesting non-existent data.\u003c/p\u003e\n"],["\u003cp\u003eTile coordinate functions can be used to convert latitude/longitude pairs into tile coordinates for specific zoom levels, enabling precise map tile retrieval.\u003c/p\u003e\n"]]],["Map Tiles API provides access to geodatasets, including roadmap, satellite, and terrain themes, divided into an indexed grid. Users request a session token and specify a map theme. Viewport information, obtained via HTTPS GET requests, determines the available imagery and zoom levels (0-22) within a defined area. Responses include copyright attribution and maximum zoom levels. Tile coordinate functions convert latitude/longitude to tile coordinates for specific zoom levels.\n"],null,["# 2D Tiles overview\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google\n| Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. [Learn more](/maps/comms/eea/faq). In addition, certain content from the Map Tiles API will no longer be returned. [Learn more](/maps/comms/eea/map-tiles).\n\nMap Tiles are simply the division of the world into an indexed\ngrid. It lets you access and utilize map data efficiently and dynamically\nat multiple cartographic scales. Map Tiles API gives you access to\nmultiple thematic geodatasets, including Google-curated:\n\n- Roadmap image tiles based on vector topographic data with Google's\n cartographic styling.\n\n- Orthophotography captured by both satellite and airborne cameras that deliver\n top down (nadir) imagery of the earth.\n\n- Hillshade contour maps.\n\n2D Map Tiles are all georeferenced and aligned to each other. They're selected\nbased on the geographic extent of the viewport and the zoom level. Zoom levels\nrange from zero (to view the world in its entirety) to 22 (to view streets and\nblocks).\n\nMap themes\n----------\n\nYou can get map tiles for the following map themes.\n\n| Map theme | Description |\n|-------------------------------------------------|----------------------------------------------------------------|\n| [Roadmap](/maps/documentation/tile/roadmap) | Roads, buildings, points of interest, and political boundaries |\n| [Satellite](/maps/documentation/tile/satellite) | Photographic imagery taken from space |\n| [Terrain](/maps/documentation/tile/terrain) | A contour map that shows natural features such as vegetation |\n\n| **Note:** Map tiles can consist of one or more layers. For example, a roadmap layer can be overlaid on top of a satellite map theme. For more information, see [Optional fields](/maps/documentation/tile/session_tokens#optional_fields).\n\nTo request map tiles from Map Tiles API, you must first request a\n[session token](/maps/documentation/tile/session_tokens). The session token\ntracks the current state of your map and viewport. When you set up your session\ntoken, you must set the `mapType` value to match the map theme that you want.\nThen, you must include the session token in each of your requests to\nMap Tiles API.\n\nViewport information requests\n-----------------------------\n\nThe viewport defines the size of the box that frames the world scene. Viewport\ninformation requests return details about the map tiles that make up your\ncurrent viewport. The reason that you request viewport information is to ensure\nthat you avoid requesting imagery at zoom levels that don't exist.\n\nFor example, most cities have imagery at zoom level 22, but not the ocean since\nit would just end up displaying featureless blue squares.\n| **Note:** Included in the response is the attribution that you must display with your map, and the maximum zoom level---so you can build a zoom slider. For more information, see the [Map Tiles API Policies](/maps/documentation/tile/policies#map-tiles-api).\n\nThe viewport request is an HTTPS GET request in the following form. \n\n```json\ncurl \"https://tile.googleapis.com/tile/v1/viewport?session=\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_SESSION_TOKEN\u003c/var\u003e&key=YOUR_API_KEY&zoom=\u003cvar class=\"apiparam\" translate=\"no\"\u003ezoom\u003c/var\u003e&north=\u003cvar class=\"apiparam\" translate=\"no\"\u003enorth\u003c/var\u003e&south=\u003cvar class=\"apiparam\" translate=\"no\"\u003esouth\u003c/var\u003e&east=\u003cvar class=\"apiparam\" translate=\"no\"\u003eeast\u003c/var\u003e&west=\u003cvar class=\"apiparam\" translate=\"no\"\u003ewest\u003c/var\u003e\"\n```\n\nThe request contains the following fields:\n\n`zoom`\n: The zoom level of the viewport.\n\n`north`, `south`, `east`, `west`\n: The furthest north, south, east, and west points in the viewport, expressed in\n degrees. North and south must be in the range (-90,90), east and west must be in\n the range (-180, 180). To express bounds crossing the antimeridian, west can be\n positive (for example, 170) and east can be negative (for example, -170). All\n parameters are required.\n\nViewport information responses\n------------------------------\n\nThe viewport response tells you which areas have imagery, and at which zoom\nlevels. A viewport information response has the following form. \n\n {\n \"copyright\": \"Map data ©2023\",\n \"maxZoomRects\": [\n {\n \"maxZoom\": 19,\n \"north\": 90,\n \"south\": -90,\n \"east\": 180,\n \"west\": -180\n },\n {\n \"maxZoom\": 9,\n \"north\": 90,\n \"south\": -90,\n \"east\": 180,\n \"west\": -180\n },\n {\n \"maxZoom\": 14,\n \"north\": 84.375,\n \"south\": -84.375,\n \"east\": 180,\n \"west\": -180\n }, ...\n ]\n }\n\n| **Note:** In this example, the `maxZoomRects` array contains more objects than is shown.\n\nThe response body contains the following fields.\n\n`copyright`\n: Contains an attribution string that you must display on your map when you\n display roadmap and satellite tiles. For more information, see the\n [Map Tiles API Policies](/maps/documentation/tile/policies#map-tiles-api).\n\n`maxZoomRect`\n: Contains an array of bounding rectangles that overlap with the current\n viewport. Also contains the maximum zoom level available within each rectangle.\n\nTile coordinate functions\n-------------------------\n\nTools (simple functions) are available in most programming languages to convert\nfrom latitude/longitude pairs to tile coordinates at a specific zoom level.\nConsider the following JavaScript code example that first converts from a\n`latLng` to a point, and then from a point to tile coordinates. \n\n var TILE_SIZE = 256;\n\n function fromLatLngToPoint(latLng) {\n var mercator = -Math.log(Math.tan((0.25 + latLng.lat() / 360) * Math.PI));\n return {\n x: TILE_SIZE * (latLng.lng() / 360 + 0.5),\n y: TILE_SIZE / 2 * (1 + mercator / Math.PI)\n };\n }\n\n function fromLatLngToTileCoord(latLng, zoom) {\n var point = fromLatLngToPoint(latLng);\n var scale = Math.pow(2, zoom);\n\n return {\n x: Math.floor(point.x * scale / TILE_SIZE),\n y: Math.floor(point.y * scale / TILE_SIZE),\n z: zoom\n };\n }"]]