सुझाव भेजें
2D टाइल की खास जानकारी
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यूरोपियन इकनॉमिक एरिया (ईईए) के डेवलपर
मैप टाइलें, दुनिया को इंडेक्स की गई ग्रिड में बांटने का एक तरीका है. इससे आपको कई कार्टोग्राफ़िक स्केल पर, मैप डेटा को बेहतर तरीके से और डाइनैमिक तरीके से ऐक्सेस और इस्तेमाल करने में मदद मिलती है. Map Tiles API से आपको कई थीम वाले जियोडेटासेट का ऐक्सेस मिलता है. इनमें Google के चुने हुए ये जियोडेटासेट शामिल हैं:
Google की कार्टोग्राफ़िक स्टाइलिंग के साथ, वेक्टर टोपोग्राफ़िक डेटा पर आधारित रोडमैप इमेज टाइल.
सैटलाइट और एयरबोर्न कैमरे, दोनों से ली गई ऑर्थोफ़ोटोग्राफ़ी. इससे पृथ्वी की ऊपर से (नादिर) इमेज मिलती है.
हिलशेड कॉन्टूर मैप.
2D मैप टाइल, सभी जियोरेफ़रंस की गई हैं और एक-दूसरे के साथ अलाइन की गई हैं. इन्हें व्यूपोर्ट के भौगोलिक दायरे और ज़ूम लेवल के आधार पर चुना जाता है. ज़ूम लेवल, शून्य से लेकर 22 तक होते हैं. शून्य का इस्तेमाल पूरी दुनिया को देखने के लिए किया जाता है, जबकि 22 का इस्तेमाल सड़कों और ब्लॉक को देखने के लिए किया जाता है.
मैप की थीम
आपको मैप की इन थीम के लिए मैप टाइल मिल सकती हैं.
मैप की थीम
ब्यौरा
रोडमैप
सड़कें, इमारतें, लोकप्रिय जगहें, और राजनैतिक सीमाएं
सैटलाइट
अंतरिक्ष से ली गई फ़ोटोग्राफ़िक इमेज
इलाका
वनस्पति जैसी प्राकृतिक चीज़ों को दिखाने वाला कॉन्टूर मैप
ध्यान दें: मैप टाइल में एक या उससे ज़्यादा लेयर हो सकती हैं. उदाहरण के लिए, रोडमैप लेयर को सैटलाइट मैप थीम के ऊपर ओवरले किया जा सकता है. ज़्यादा जानकारी के लिए, वैकल्पिक फ़ील्ड लेख पढ़ें.
Map Tiles API से मैप टाइल का अनुरोध करने के लिए, आपको सबसे पहले सेशन टोकन का अनुरोध करना होगा. सेशन टोकन, आपके मैप और व्यूपोर्ट की मौजूदा स्थिति को ट्रैक करता है. सेशन टोकन सेट अप करते समय, आपको mapType
वैल्यू को उस मैप थीम से मैच करना होगा जो आपको चाहिए.
इसके बाद, आपको Map Tiles API को किए जाने वाले हर अनुरोध में सेशन टोकन शामिल करना होगा.
व्यूपोर्ट की जानकारी के अनुरोध
व्यूपोर्ट से, दुनिया के सीन को फ़्रेम करने वाले बॉक्स का साइज़ तय होता है. व्यूपोर्ट की जानकारी के अनुरोधों से, मैप की उन टाइलों के बारे में जानकारी मिलती है जो आपके मौजूदा व्यूपोर्ट को बनाती हैं. व्यू पोर्ट की जानकारी का अनुरोध करने की वजह यह है कि आप ऐसे ज़ूम लेवल पर इमेज का अनुरोध न करें जो मौजूद नहीं हैं.
उदाहरण के लिए, ज़्यादातर शहरों की इमेज, ज़ूम लेवल 22 पर उपलब्ध होती हैं. हालांकि, महासागर की इमेज इस लेवल पर उपलब्ध नहीं होती, क्योंकि इसमें सिर्फ़ नीले रंग के स्क्वेयर दिखते हैं.
ध्यान दें: जवाब में एट्रिब्यूशन शामिल होता है, जिसे आपको अपने मैप के साथ दिखाना होगा. साथ ही, इसमें ज़ूम का ज़्यादा से ज़्यादा लेवल भी शामिल होता है, ताकि ज़ूम स्लाइडर बनाया जा सके. ज़्यादा जानकारी के लिए, Map Tiles API की नीतियां देखें.
व्यूपोर्ट का अनुरोध, इस तरह का एचटीटीपीएस 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) के तौर पर दिखाया जा सकता है. सभी पैरामीटर ज़रूरी हैं.
व्यूपोर्ट की जानकारी से जुड़े जवाब
व्यूपोर्ट रिस्पॉन्स से पता चलता है कि किन इलाकों की इमेज उपलब्ध हैं और उन्हें किस ज़ूम लेवल पर देखा जा सकता है. व्यू पोर्ट की जानकारी देने वाले रिस्पॉन्स का फ़ॉर्मैट यहां दिया गया है.
{
"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
इसमें बाउंडिंग रेक्टैंगल का एक ऐसा कलेक्शन होता है जो मौजूदा व्यूपोर्ट के साथ ओवरलैप करता है. इसमें हर रेक्टैंगल के लिए, ज़ूम का ज़्यादा से ज़्यादा लेवल भी शामिल होता है.
टाइल कोऑर्डिनेट फ़ंक्शन
ज़्यादातर प्रोग्रामिंग भाषाओं में टूल (सामान्य फ़ंक्शन) उपलब्ध होते हैं. इनकी मदद से, किसी खास ज़ूम लेवल पर अक्षांश/देशांतर के जोड़े को टाइल के निर्देशांकों में बदला जा सकता है.
यहां JavaScript कोड का एक उदाहरण दिया गया है. इसमें पहले 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 और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया.
क्या आपको हमें और कुछ बताना है?
[[["समझने में आसान है","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-08-29 (UTC) को अपडेट किया गया."],[[["\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 }"]]