সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Maps Android Kotlin এক্সটেনশন (KTX) হল Android এর জন্য Maps SDK এবং Android ইউটিলিটি লাইব্রেরির জন্য Maps SDK-এর জন্য Kotlin এক্সটেনশনগুলির একটি সংগ্রহ৷ এই এক্সটেনশনগুলি কোটলিন ভাষার বৈশিষ্ট্যগুলি প্রদান করে যা আপনাকে Android-এর জন্য মানচিত্র SDK-এর জন্য বিকাশ করার সময় সংক্ষিপ্ত এবং বাজে Kotlin লিখতে সক্ষম করে৷ মানচিত্র KTX ওপেন সোর্স এবং উদাহরণ সহ GitHub- এ উপলব্ধ।
ইনস্টলেশন
Android এর জন্য Maps SDK-এর জন্য KTX ইনস্টল করতে এবং ঐচ্ছিকভাবে Android ইউটিলিটি লাইব্রেরির জন্য Maps SDK-এর জন্য, আপনার build.gradle.kts ফাইলে নিম্নলিখিত নির্ভরতা যোগ করুন।
dependencies{// KTX for the Maps SDK for Android libraryimplementation("com.google.maps.android:maps-ktx:5.2.0")}
উদাহরণ ব্যবহার
KTX লাইব্রেরির মাধ্যমে, আপনি অনেকগুলি কোটলিন ভাষার বৈশিষ্ট্য যেমন এক্সটেনশন ফাংশন, নামযুক্ত প্যারামিটার এবং ডিফল্ট আর্গুমেন্ট, ধ্বংস ঘোষণা এবং কোরোটিনগুলির সুবিধা নিতে পারেন।
coroutines ব্যবহার করে একটি GoogleMap পুনরুদ্ধার করা হচ্ছে
একটি GoogleMap অ্যাক্সেস করা কোরোটিন ব্যবহার করে পুনরুদ্ধার করা যেতে পারে।
একটি মার্কার যোগ করা DSL-শৈলী পদ্ধতি addMarker() ব্যবহার করে করা যেতে পারে।
val sydney = LatLng(-33.852, 151.211)
val marker = googleMap.addMarker {
position(sydney)
title("Marker in Sydney")
}
ক্যামেরা ইভেন্ট সংগ্রহ করা হচ্ছে
ইভেন্ট, যেমন ক্যামেরা মুভ, কোটলিন ফ্লো এর মাধ্যমে সংগ্রহ করা যেতে পারে।
lifecycleScope.launch{lifecycle.repeatOnLifecycle(Lifecycle.State.CREATED){googleMap.cameraMoveEvents().collect{print("Received camera move event")}}}
আপনি রেফারেন্স ডকুমেন্টেশন পড়ে সমর্থিত বৈশিষ্ট্যগুলির একটি সম্পূর্ণ তালিকা দেখতে পারেন।
নমুনা অ্যাপ্লিকেশন চেষ্টা করুন
এই লাইব্রেরির জন্য GitHub সংগ্রহস্থলে একটি ডেমো অ্যাপ্লিকেশন রয়েছে যা দেখায় যে আপনি কীভাবে আপনার নিজের অ্যাপে মানচিত্র KTX লাইব্রেরি ব্যবহার করতে পারেন।
ডেমো অ্যাপ্লিকেশন চেষ্টা করতে, এই পদক্ষেপগুলি অনুসরণ করুন:
GitHub থেকে, জিপ ফাইলটি ক্লোন করুন বা ডাউনলোড করুন।
অ্যান্ড্রয়েড স্টুডিওতে, ফাইল -> খুলুন এবং ডিরেক্টরিতে নেভিগেট করুন এবং আপনি এইমাত্র ক্লোন বা ডাউনলোড করেছেন এমন ফোল্ডারটি খুলুন।
[[["সহজে বোঝা যায়","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-09-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eMaps Android Kotlin extensions (KTX) offer Kotlin features for concise and idiomatic development with the Maps SDK for Android.\u003c/p\u003e\n"],["\u003cp\u003eYou can add markers, retrieve GoogleMap using coroutines, and collect camera events using Kotlin Flows with Maps KTX.\u003c/p\u003e\n"],["\u003cp\u003eThe library is open-source and available on GitHub with a demo application showcasing its functionalities.\u003c/p\u003e\n"],["\u003cp\u003eMaps KTX can be easily installed by adding a dependency to your \u003ccode\u003ebuild.gradle.kts\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eOther KTX libraries are available for the Maps SDK for Android Utility Library and Places SDK for Android.\u003c/p\u003e\n"]]],[],null,["Maps Android Kotlin extensions (KTX) are a collection of Kotlin extensions for the Maps SDK for\nAndroid and the Maps SDK for Android Utility Library. These extensions provide\nKotlin language features that enable you to write concise and idiomatic Kotlin\nwhen developing for the Maps SDK for Android. Maps KTX is open-sourced and\navailable on [GitHub](https://github.com/googlemaps/android-maps-ktx) along with\nexamples.\n\nInstallation\n\nTo install KTX for the Maps SDK for Android, and optionally for the Maps SDK for\nAndroid Utility Library, add the following dependencies to your `build.gradle.kts`\nfile. \n\n```carbon\ndependencies {\n\n // KTX for the Maps SDK for Android library\n implementation(\"com.google.maps.android:maps-ktx:5.2.0\")\n}\n```\n\nExample Usages\n\nWith the KTX library, you can take advantage of several Kotlin language\nfeatures such as extension functions, named parameters and default arguments,\ndestructuring declarations, and coroutines.\n\nRetrieving a GoogleMap using coroutines\n\nAccessing a [`GoogleMap`](/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/GoogleMap) can be retrieved\nusing coroutines. \n\n```scalate-server-page\nlifecycleScope.launch {\n lifecycle.repeatOnLifecycle(Lifecycle.State.CREATED) {\n val mapFragment: SupportMapFragment? =\n supportFragmentManager.findFragmentById(R.id.map) as? SupportMapFragment\n val googleMap: GoogleMap? = mapFragment?.awaitMap()\n }\n}\n```\n\nAdding a marker\n\nAdding a marker can be done using the DSL-style method `addMarker()`. \n\n```text\nval sydney = LatLng(-33.852, 151.211)\nval marker = googleMap.addMarker {\n position(sydney)\n title(\"Marker in Sydney\")\n}\n```\n\nCollecting camera events\n\nEvents, such as camera moves, can be collected via [Kotlin Flow](https://developer.android.com/kotlin/flow). \n\n```povray\nlifecycleScope.launch {\n lifecycle.repeatOnLifecycle(Lifecycle.State.CREATED) {\n googleMap.cameraMoveEvents().collect {\n print(\"Received camera move event\")\n }\n }\n}\n```\n\nYou can see a full list of supported features by reading the\n[reference documentation](https://googlemaps.github.io/android-maps-ktx).\n\nTry the sample application\n\nThe GitHub repository for this library also contains a [demo application](https://github.com/googlemaps/android-maps-ktx/tree/main/app)\nthat shows how you can use the Maps KTX library in your own app.\n\nTo try the demo application, follow these steps:\n\n1. From [GitHub](https://github.com/googlemaps/android-maps-ktx), clone the or download the ZIP file.\n2. In Android Studio, choose **File -\\\u003e Open** and navigate to the directory and open the folder that you just cloned or downloaded.\n3. Add an API key to the demo app.\n 1. [Get a Maps SDK for Android key](/maps/documentation/android-sdk/get-api-key).\n 2. In the root directory, create a file called `secrets.properties`. This file should NOT be under version control to protect your API key.\n 3. Add this single line to `secrets.properties` \n\n ```\n MAPS_API_KEY=\"YOUR_API_KEY\"\n ```\n where `YOUR_API_KEY` is the actual API key you obtained in the first step. You can look at the [`secrets.defaults.properties`](https://github.com/googlemaps/android-maps-ktx/blob/main/secrets.defaults.properties) as an example.\n4. Under the run configuration, select the module **app-ktx**.\n5. Select **Run 'app-ktx'.**\n\nWhat's next\n\nYou may also be interested in other Kotlin extension libraries for Google Maps\nPlatform:\n\n- [KTX](/maps/documentation/android-sdk/utility/setup#ktx) for the Map SDK for Android Utility Library\n- [KTX](/maps/documentation/places/android-sdk/ktx#install) for the Places SDK for Android"]]