सूचना: Google Maps Platform में, बेसमैप की नई स्टाइल जल्द ही उपलब्ध होगी. मैप की स्टाइल में किए गए इस अपडेट में, नया डिफ़ॉल्ट कलर पैलेट, आधुनिक पिन, और मैप के अनुभव और इस्तेमाल में सुधार शामिल हैं. मार्च 2025 में, सभी मैप स्टाइल अपने-आप अपडेट हो जाएंगे. उपलब्धता और पहले से ऑप्ट-इन करने के तरीके के बारे में ज़्यादा जानने के लिए, Google Maps Platform के लिए नया मैप स्टाइल लेख पढ़ें.
ओवरले, मैप पर मौजूद ऐसे ऑब्जेक्ट होते हैं जो अक्षांश/देशांतर के निर्देशांक से जुड़े होते हैं. इसलिए, मैप को खींचने या ज़ूम करने पर, ये ऑब्जेक्ट भी अपने-आप खिसक जाते हैं. अगर आपको मैप पर कोई इमेज जोड़नी है, तो GroundOverlay ऑब्जेक्ट का इस्तेमाल करें.
अन्य तरह के ओवरले के बारे में जानने के लिए, मैप पर ड्रॉ करना लेख पढ़ें.
ग्राउंड ओवरले जोड़ना
GroundOverlay के लिए कन्स्ट्रक्टर, पैरामीटर के तौर पर इमेज का यूआरएल और इमेज का LatLngBounds बताता है. इमेज को मैप पर रेंडर किया जाएगा. साथ ही, उसे तय की गई सीमाओं के मुताबिक दिखाया जाएगा. इसके बाद, मैप के प्रोजेक्शन का इस्तेमाल करके उसे सही किया जाएगा.
TypeScript
// This example uses a GroundOverlay to place an image on the map// showing an antique map of Newark, NJ.lethistoricalOverlay;functioninitMap():void{constmap=newgoogle.maps.Map(document.getElementById("map")asHTMLElement,{zoom:13,center:{lat:40.74,lng:-74.18},});constimageBounds={north:40.773941,south:40.712216,east:-74.12544,west:-74.22655,};historicalOverlay=newgoogle.maps.GroundOverlay("https://storage.googleapis.com/geo-devrel-public-buckets/newark_nj_1922-661x516.jpeg",imageBounds);historicalOverlay.setMap(map);}declareglobal{interfaceWindow{initMap:()=>void;}}window.initMap=initMap;
// This example uses a GroundOverlay to place an image on the map// showing an antique map of Newark, NJ.lethistoricalOverlay;functioninitMap(){constmap=newgoogle.maps.Map(document.getElementById("map"),{zoom:13,center:{lat:40.74,lng:-74.18},});constimageBounds={north:40.773941,south:40.712216,east:-74.12544,west:-74.22655,};historicalOverlay=newgoogle.maps.GroundOverlay("https://storage.googleapis.com/geo-devrel-public-buckets/newark_nj_1922-661x516.jpeg",imageBounds,);historicalOverlay.setMap(map);}window.initMap=initMap;
मैप से ओवरले हटाने के लिए, null को पास करते हुए, ओवरले के setMap() तरीके को कॉल करें. ध्यान दें कि
इस तरीके को कॉल करने से ओवरले नहीं मिटता. इससे मैप से ओवरले हट जाता है. अगर आपको ओवरले मिटाना है, तो
आपको उसे मैप से हटाना होगा. इसके बाद, खुद ही ओवरले को null पर सेट करें.
[[["समझने में आसान है","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-12-22 (UTC) को अपडेट किया गया."],[[["Ground overlays let you place images on a map tied to latitude/longitude coordinates."],["You can add a ground overlay using the `GroundOverlay` object, specifying the image URL and boundaries."],["To remove a ground overlay from the map, call `setMap(null)` on the overlay object."],["Removing an overlay from the map doesn't delete it; to delete it, set the overlay object to `null` after removing it from the map."]]],["Ground overlays, images tied to latitude/longitude coordinates, are added to a map using the `GroundOverlay` constructor, specifying an image URL and `LatLngBounds`. The `setMap()` method then renders the image. Removing an overlay involves calling `setMap(null)` on the overlay object, which detaches it from the map but doesn't delete it. To delete the overlay it needs to be set to null. Example code is provided in TypeScript and JavaScript.\n"]]