গ্রাউন্ড ওভারলে
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
গ্রাউন্ড ওভারলেগুলি মানচিত্রের ওভারলে যা অক্ষাংশ/দ্রাঘিমাংশ স্থানাঙ্কের সাথে আবদ্ধ থাকে, তাই আপনি যখন মানচিত্রটি টেনে বা জুম করেন তখন তারা সরে যায়।

ভূমিকা
একটি গ্রাউন্ড ওভারলে একটি চিত্র যা একটি মানচিত্রে স্থির করা হয়। মার্কারগুলির বিপরীতে, গ্রাউন্ড ওভারলেগুলি স্ক্রীনের পরিবর্তে পৃথিবীর পৃষ্ঠের বিপরীতে থাকে, তাই মানচিত্রটিকে ঘোরানো, কাত করা বা জুম করা চিত্রটির অভিযোজন পরিবর্তন করবে৷
একটি গ্রাউন্ড ওভারলে যোগ করতে, একটি GMSGroundOverlay
অবজেক্ট তৈরি করুন যা একটি আইকন এবং একটি সীমা উভয়কে সংজ্ঞায়িত করে। কোনো একটি নির্দিষ্ট করতে ব্যর্থ হলে গ্রাউন্ড ওভারলে মানচিত্রে প্রদর্শিত হবে না। আপনি ঐচ্ছিকভাবে অতিরিক্ত সেটিংস নির্দিষ্ট করতে পারেন যা মানচিত্রে চিত্রের অবস্থানকে প্রভাবিত করবে। একবার আপনি প্রয়োজনীয় বিকল্পগুলি সংজ্ঞায়িত করলে, ওভারলে যোগ করতে এই বস্তুর map
বৈশিষ্ট্য সেট করুন।
একটি ওভারলে যোগ করা হচ্ছে
- একটি নতুন
GMSGroundOverlay
অবজেক্ট ইনস্ট্যান্টিয়েট করুন -
UIImage
এর একটি উদাহরণে icon
বৈশিষ্ট্য সেট করুন। -
GMSCoordinateBounds
এর একটি উদাহরণে bounds
সম্পত্তি সেট করুন। সীমানাগুলি চিত্রের দক্ষিণ পশ্চিম এবং উত্তর পূর্ব কোণগুলিকে প্রতিনিধিত্ব করে৷ - ঐচ্ছিক বৈশিষ্ট্যগুলি সেট করুন, যেমন
bearing
এবং zoomLevel
পছন্দসই। -
map
বৈশিষ্ট্য সেট করুন - চিত্রটি মানচিত্রে প্রদর্শিত হবে।
নীচের উদাহরণটি দেখায় যে কীভাবে একটি বিদ্যমান GMSMapView
অবজেক্টে একটি গ্রাউন্ড ওভারলে যুক্ত করতে হয়।
সুইফট
let southWest = CLLocationCoordinate2D(latitude: 40.712216, longitude: -74.22655)
let northEast = CLLocationCoordinate2D(latitude: 40.773941, longitude: -74.12544)
let overlayBounds = GMSCoordinateBounds(coordinate: southWest, coordinate: northEast)
// Image from http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg
let icon = UIImage(named: "newark_nj_1922")
let overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)
overlay.bearing = 0
overlay.map = mapView
উদ্দেশ্য-C
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(40.712216,-74.22655);
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(40.773941,-74.12544);
GMSCoordinateBounds *overlayBounds = [[GMSCoordinateBounds alloc] initWithCoordinate:southWest
coordinate:northEast];
// Image from http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg
UIImage *icon = [UIImage imageNamed:@"newark_nj_1922"];
GMSGroundOverlay *overlay = [GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];
overlay.bearing = 0;
overlay.map = mapView;
একটি ওভারলে অপসারণ
আপনি আপনার GMSGroundOverlay
এর map
সম্পত্তি nil
সেট করে মানচিত্র থেকে একটি গ্রাউন্ড ওভারলে সরাতে পারেন। বিকল্পভাবে, আপনি GMSMapView
clear
পদ্ধতিতে কল করে সমস্ত ওভারলে (বর্তমানে মানচিত্রে থাকা গ্রাউন্ড ওভারলে সহ) সরাতে পারেন।
উদ্দেশ্য-C
[mapView clear];
আপনি যদি মানচিত্রে যোগ করার পরে একটি গ্রাউন্ড ওভারলেতে পরিবর্তন করতে চান তবে নিশ্চিত করুন যে আপনি GMSGroundOverlay
অবজেক্টটিকে ধরে রেখেছেন। আপনি এই বস্তুতে পরিবর্তন করে পরে গ্রাউন্ড ওভারলে পরিবর্তন করতে পারেন।
সুইফট
let overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)
overlay.bearing = 0
overlay.map = mapView
// ...
overlay.isTappable = true
উদ্দেশ্য-C
GMSGroundOverlay *overlay = [GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];
overlay.bearing = 0;
overlay.map = mapView;
// ...
overlay.tappable = YES;
ঘটনা
আপনি ম্যাপে ঘটে যাওয়া ইভেন্টগুলি শুনতে পারেন, যেমন যখন একজন ব্যবহারকারী একটি ওভারলে ট্যাপ করে। ইভেন্টগুলি শুনতে, আপনাকে অবশ্যই GMSMapViewDelegate
প্রোটোকল প্রয়োগ করতে হবে৷ GMSMapViewDelegate
এ ইভেন্টের নির্দেশিকা এবং পদ্ধতির তালিকা দেখুন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eGround overlays are images fixed to a map, oriented to the Earth's surface, and change orientation with map interactions.\u003c/p\u003e\n"],["\u003cp\u003eTo add a ground overlay, create a \u003ccode\u003eGMSGroundOverlay\u003c/code\u003e object, define its icon, bounds, and optional settings, then set its \u003ccode\u003emap\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eGround overlays can be removed by setting the \u003ccode\u003emap\u003c/code\u003e property to \u003ccode\u003enil\u003c/code\u003e or using the \u003ccode\u003eclear\u003c/code\u003e method on the \u003ccode\u003eGMSMapView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eModifications to existing ground overlays can be made by accessing and updating the \u003ccode\u003eGMSGroundOverlay\u003c/code\u003e object directly.\u003c/p\u003e\n"],["\u003cp\u003eImplement the \u003ccode\u003eGMSMapViewDelegate\u003c/code\u003e protocol to listen to events like user taps on the overlay.\u003c/p\u003e\n"]]],["Ground overlays, images fixed to a map using latitude/longitude, are added by creating a `GMSGroundOverlay` object. This requires setting both the `icon` (an image) and `bounds` (southwest/northeast coordinates). Optionally, set properties like `bearing` and `zoomLevel`. To display, assign the object's `map` property. Overlays are removed by setting `map` to `nil` or using the `clear` method. Modifications require retaining the `GMSGroundOverlay` object and to listen for events, you must implement `GMSMapViewDelegate`.\n"],null,["Select platform: [Android](/maps/documentation/android-sdk/groundoverlay \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/overlays \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/groundoverlays \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nGround overlays are overlays on the map that are tied to latitude/longitude\ncoordinates, so they move when you drag or zoom the map.\n\nIntroduction\n\nA ground overlay is an image that is fixed to a map. Unlike\n[markers](/maps/documentation/ios-sdk/marker), ground overlays are oriented against the Earth's surface\nrather than the screen, so rotating, tilting or zooming the map will change\nthe orientation of the image.\n\nTo add a ground overlay, create a\n[`GMSGroundOverlay`](/maps/documentation/ios-sdk/reference/objc/Classes/GMSGroundOverlay)\nobject that defines both an icon and a bounds. Failing to specify either will\ncause the ground overlay to not appear on the map. You can optionally specify\nadditional settings that will affect the positioning of the image on the map.\nOnce you've defined the necessary options, set this object's `map` property to\nadd the overlay.\n\nAdding an overlay\n\n1. Instantiate a new `GMSGroundOverlay` object\n2. Set the `icon` property to an instance of `UIImage`.\n3. Set the `bounds` property to an instance of `GMSCoordinateBounds`. The bounds represent the south west, and north east corners of the image.\n4. Set optional properties, such as `bearing` and `zoomLevel`, as desired.\n5. Set the `map` property - the image appears on the map.\n\nThe below example demonstrates how to add a ground overlay to an existing\n`GMSMapView` object.\n\n\nSwift \n\n```swift\nlet southWest = CLLocationCoordinate2D(latitude: 40.712216, longitude: -74.22655)\nlet northEast = CLLocationCoordinate2D(latitude: 40.773941, longitude: -74.12544)\nlet overlayBounds = GMSCoordinateBounds(coordinate: southWest, coordinate: northEast)\n\n// Image from http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg\nlet icon = UIImage(named: \"newark_nj_1922\")\n\nlet overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)\noverlay.bearing = 0\noverlay.map = mapView\n \n```\n\nObjective-C \n\n```objective-c\nCLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(40.712216,-74.22655);\nCLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(40.773941,-74.12544);\nGMSCoordinateBounds *overlayBounds = [[GMSCoordinateBounds alloc] initWithCoordinate:southWest\n coordinate:northEast];\n\n// Image from http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg\nUIImage *icon = [UIImage imageNamed:@\"newark_nj_1922\"];\nGMSGroundOverlay *overlay = [GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];\noverlay.bearing = 0;\noverlay.map = mapView;\n \n```\n\n\u003cbr /\u003e\n\nRemoving an overlay\n\nYou can remove a ground overlay from the map by setting your\n`GMSGroundOverlay`'s `map` property to `nil`. Alternately, you can remove all\nof the overlays (including ground overlays currently on the map by calling the\n`GMSMapView` `clear` method.\n\n\nSwift \n\n```swift\nmapView.clear()\n \n```\n\nObjective-C \n\n```objective-c\n[mapView clear];\n \n```\n\n\u003cbr /\u003e\n\nIf you wish to make modifications to a ground overlay after you've added it to\nthe map, ensure that you keep hold of the `GMSGroundOverlay` object. You can\nmodify the ground overlay later by making changes to this object.\n\n\nSwift \n\n```swift\nlet overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)\noverlay.bearing = 0\noverlay.map = mapView\n\n// ...\n\noverlay.isTappable = true\n \n```\n\nObjective-C \n\n```objective-c\nGMSGroundOverlay *overlay = [GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];\noverlay.bearing = 0;\noverlay.map = mapView;\n\n// ...\noverlay.tappable = YES;\n \n```\n\n\u003cbr /\u003e\n\nEvents\n\nYou can listen to events that occur on the map, such as when a user taps an\noverlay. To listen to events, you must implement the\n[`GMSMapViewDelegate`](/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate) protocol. See the\n[guide to events](/maps/documentation/ios-sdk/events) and the list of methods on the\n[`GMSMapViewDelegate`](/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate)."]]