সীমানার জন্য ডেটা-চালিত স্টাইলিং ব্যবহার করতে আপনাকে অবশ্যই একটি মানচিত্র আইডি তৈরি করতে হবে। এর পরে, আপনাকে অবশ্যই একটি নতুন মানচিত্রের শৈলী তৈরি করতে হবে, প্রয়োজনীয় সীমানা বৈশিষ্ট্য স্তরগুলি নির্বাচন করতে হবে এবং আপনার মানচিত্র আইডির সাথে শৈলীটি সংযুক্ত করতে হবে৷
একটি মানচিত্র আইডি তৈরি করুন
একটি ম্যাপআইডি একটি অনন্য শনাক্তকারী যা একটি Google মানচিত্রের একটি একক উদাহরণ উপস্থাপন করে। আপনি Google ক্লাউড কনসোলে যেকোনো সময় মানচিত্র আইডি তৈরি করতে এবং একটি মানচিত্র আইডির সাথে যুক্ত একটি শৈলী আপডেট করতে পারেন।
একটি নতুন মানচিত্র শৈলী তৈরি করুন
একটি নতুন মানচিত্রের শৈলী তৈরি করতে, শৈলী তৈরি করতে মানচিত্র শৈলী পরিচালনা করুন- এ নির্দেশাবলী অনুসরণ করুন৷ একবার সম্পূর্ণ হলে নতুন তৈরি মানচিত্র আইডির সাথে স্টাইলটি সংযুক্ত করুন।
বৈশিষ্ট্য স্তর নির্বাচন করুন
Google ক্লাউড কনসোলে আপনি কোন বৈশিষ্ট্য স্তরগুলি প্রদর্শন করতে চান তা নির্বাচন করতে পারেন৷ এটি নির্ধারণ করে যে কোন ধরণের সীমানা মানচিত্রে প্রদর্শিত হবে (উদাহরণস্বরূপ স্থানীয় এলাকা, রাজ্য এবং আরও অনেক কিছু)।
স্তর যোগ করতে বা সরাতে বৈশিষ্ট্য স্তর ড্রপ-ডাউন ক্লিক করুন.
আপনার পরিবর্তনগুলি সংরক্ষণ করতে এবং সেগুলিকে আপনার মানচিত্রে উপলব্ধ করতে সংরক্ষণ করুন ক্লিক করুন৷
আপনার মানচিত্র প্রারম্ভিক কোড আপডেট করুন
এই পদক্ষেপের জন্য একটি মানচিত্র আইডি একটি শৈলীর সাথে যুক্ত করা প্রয়োজন যাতে এক বা একাধিক বৈশিষ্ট্য স্তর সক্ষম থাকে৷ ক্লাউড কনসোলে আপনার মানচিত্র আইডি সঠিকভাবে সেট আপ করা হয়েছে তা যাচাই করতে, মানচিত্র ব্যবস্থাপনার অধীনে এটি কীভাবে কনফিগার করা হয়েছে তা পর্যালোচনা করুন।
সুইফট
// A map ID using a style with one or more feature layers enabledletmapID=GMSMapID(identifier:"YOUR_MAP_ID")letmapView=GMSMapView(frame:.zero,mapID:mapID,camera:GMSCameraPosition(latitude:40,longitude:-80,zoom:7))
উদ্দেশ্য-C
// A map ID using a style with one or more feature layers enabledGMSMapID*mapID=[GMSMapIDmapIDWithIdentifier:@"MAP_ID"];GMSMapView*mapView=[GMSMapViewmapWithFrame:CGRectZeromapID:mapIDcamera:[GMSCameraPositioncameraWithLatitude:40longitude:-80zoom:7]];
একটি মানচিত্রে বৈশিষ্ট্য স্তর যোগ করুন
আপনার মানচিত্রে একটি বৈশিষ্ট্য স্তরের একটি রেফারেন্স পেতে, মানচিত্র শুরু হলে mapView.featureLayer(of:) কল করুন:
সীমানাগুলির জন্য ডেটা-চালিত স্টাইলিং এর জন্য এমন ক্ষমতার প্রয়োজন যা Google ক্লাউড কনসোলে সক্ষম এবং একটি মানচিত্র ID এর সাথে যুক্ত। যেহেতু মানচিত্র আইডিগুলি পরিবর্তন সাপেক্ষে, আপনি একটি GMSMapView এ mapView.mapCapabilities কল করতে পারেন যেটি কল করার আগে একটি নির্দিষ্ট ক্ষমতা (উদাহরণস্বরূপ ডেটা-চালিত স্টাইলিং) উপলব্ধ কিনা তা যাচাই করতে।
এছাড়াও আপনি GMSViewDelegate এ সদস্যতা নিয়ে মানচিত্রের ক্ষমতার পরিবর্তনগুলি সনাক্ত করতে পারেন৷ এই উদাহরণটি দেখায় কিভাবে ডেটা-চালিত স্টাইলিং প্রয়োজনীয়তা পরীক্ষা করতে প্রোটোকল ব্যবহার করতে হয়।
সুইফট
classSampleViewController:UIViewController{privatelazyvarmapView:GMSMapView=GMSMapView(frame:.zero,mapID:GMSMapID(identifier:"YOUR_MAP_ID"),camera:GMSCameraPosition(latitude:40,longitude:-80,zoom:7))overridefuncloadView(){self.view=mapViewmapView.delegate=self}}extensionSampleViewController:GMSMapViewDelegate{funcmapView(_mapView:GMSMapView,didChangemapCapabilities:GMSMapCapabilityFlags){if(!mapCapabilities.contains(.dataDrivenStyling)){// Data-driven styling is *not* available, add a fallback.// Existing feature layers are also unavailable.}}}
উদ্দেশ্য-C
@interfaceSampleViewController: UIViewController<GMSMapViewDelegate>
@end@implementationSampleViewController-(void)loadView{GMSMapView*mapView=[GMSMapViewmapWithFrame:CGRectZeromapID:[GMSMapIDmapIDWithIdentifier:@"MAP_ID"]camera:[GMSCameraPositioncameraWithLatitude:40longitude:-80zoom:7]];mapView.delegete=self;self.view=mapView;}-(void)mapView:(GMSMapView*)mapViewdidChangeMapCapabilities:(GMSMapCapabilityFlags)mapCapabilities{if(!(mapCapabilities&GMSMapCapabilityFlagsDataDrivenStyling)){// Data-driven styling is *not* available, add a fallback.// Existing feature layers are also unavailable.}}@end
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eData-driven styling for boundaries requires creating a map ID and associating it with a custom map style that includes selected feature layers.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage feature layers, such as localities and states, in the Google Cloud console to control which boundaries are displayed.\u003c/p\u003e\n"],["\u003cp\u003eUpdate your map initialization code to use the map ID, ensuring data-driven styling is enabled for the map.\u003c/p\u003e\n"],["\u003cp\u003eUtilize \u003ccode\u003emapView.featureLayer(of:)\u003c/code\u003e to access specific feature layers on your map for further styling or interaction.\u003c/p\u003e\n"],["\u003cp\u003eVerify map capabilities, including data-driven styling, using \u003ccode\u003emapView.mapCapabilities\u003c/code\u003e or by subscribing to \u003ccode\u003eGMSViewDelegate\u003c/code\u003e to detect changes and implement fallbacks if needed.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/dds-boundaries/start \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/dds-boundaries/start \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/dds-boundaries/start \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nTo use data-driven styling for boundaries you must create a map ID. Next, you\nmust create a new map style, select the needed boundary feature layers, and\nassociate the style with your map ID.\n\nCreate a map ID\n\nA [mapID](/maps/documentation/get-map-id) is a unique identifier that represents\na single instance of a Google Map. You can create map IDs and update a style\nassociated with a map ID at any time in the Google Cloud console.\n\nCreate a new map style\n\nTo create a new map style, follow the instructions in [Manage map\nstyles](/maps/documentation/ios-sdk/cloud-customization/map-styles) to create\nthe style. Once complete associate the style with the newly created map ID.\n| **Experimental:** This feature can only be set for light map styles. When you link a light map style that has this feature enabled to a [map\n| ID](../map-ids/mapid-over), the enabled layers are also available for the dark map style.\n\nSelect feature layers\n\nIn the Google Cloud console you can select which feature layers to display. This\ndetermines which kinds of boundaries appear on the map (for example localities,\nstates, and so on).\n| **Important:** For optimal performance, only select the layers you need.\n\nManage feature layers\n\n1. In the Google Cloud console, [go to the Map Styles\n page](https://console.cloud.google.com/project/_/google/maps-apis/studio/styles)\n\n2. Select a project if prompted.\n\n3. Select a map style.\n\n4. Click the **Feature layers** drop-down to add or remove layers.\n\n5. Click **Save** to save your changes and make them available to your maps.\n\nUpdate your map initialization code\n\nThis step requires a map ID be associated with a style with one or more feature\nlayers enabled. To verify your map ID is set up correctly in\nCloud console, review how it is configured under [Maps\nManagement](https://console.cloud.google.com/google/maps-apis/studio/maps). \n\nSwift \n\n```swift\n// A map ID using a style with one or more feature layers enabled\n\nlet mapID = GMSMapID(identifier: \"YOUR_MAP_ID\")\nlet mapView = GMSMapView(frame: .zero, mapID: mapID, camera: GMSCameraPosition(latitude: 40, longitude: -80, zoom: 7))\n```\n\nObjective-C \n\n```objective-c\n// A map ID using a style with one or more feature layers enabled\n\nGMSMapID *mapID = [GMSMapID mapIDWithIdentifier:@\"MAP_ID\"];\nGMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero mapID:mapID camera:[GMSCameraPosition cameraWithLatitude:40 longitude:-80 zoom:7]];\n```\n| **Important:** For testing, you can skip the step of creating and configuring a [map\n| ID](/maps/documentation/get-map-id), by using mapId: [`DEMO_MAP_ID`](/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapID) in your app code. `DEMO_MAP_ID` is intended for testing purposes only. Don't use `DEMO_MAP_ID` in a production environment.\n\nAdd feature layers to a map\n\nTo get a reference to a feature layer on your map, call\n[`mapView.featureLayer(of:)`](/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView#-featurelayeroffeaturetype:)\nwhen the map initializes: \n\nSwift \n\n```swift\nlet layer = mapView.featureLayer(of: .locality)\n```\n\nObjective-C \n\n```objective-c\nGMSFeatureLayer *layer = [mapView featureLayerOfFeatureType:GMSFeatureTypeLocality];\n```\n\nCheck map capabilities\n\nData-driven styling for boundaries requires capabilities which are enabled in the\nGoogle Cloud console, and associated with a map ID. Because map IDs are subject to\nchange, you can call\n[`mapView.mapCapabilities`](/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView#mapcapabilities)\non a [`GMSMapView`](/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView) to verify whether a certain capability (for\nexample data-driven styling) is available prior to calling it.\n\nYou can also detect changes in map capabilities by subscribing to\n[`GMSViewDelegate`](/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate). This example shows how to use the\nprotocol to check for data-driven styling requirements. \n\nSwift \n\n```swift\nclass SampleViewController: UIViewController {\n\n private lazy var mapView: GMSMapView = GMSMapView(frame: .zero, mapID: GMSMapID(identifier: \"YOUR_MAP_ID\"), camera: GMSCameraPosition(latitude: 40, longitude: -80, zoom: 7))\n\n override func loadView() {\n self.view = mapView\n mapView.delegate = self\n }\n}\n\nextension SampleViewController: GMSMapViewDelegate {\n func mapView(_ mapView: GMSMapView, didChange mapCapabilities: GMSMapCapabilityFlags) {\n if (!mapCapabilities.contains(.dataDrivenStyling)) {\n // Data-driven styling is *not* available, add a fallback.\n // Existing feature layers are also unavailable.\n }\n }\n}\n```\n\nObjective-C \n\n```objective-c\n@interface SampleViewController: UIViewController \u003cGMSMapViewDelegate\u003e\n@end\n\n@implementation SampleViewController\n- (void)loadView {\n GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero mapID:[GMSMapID mapIDWithIdentifier:@\"MAP_ID\"] camera:[GMSCameraPosition cameraWithLatitude:40 longitude:-80 zoom:7]];\n mapView.delegete = self;\n self.view = mapView;\n}\n\n- (void)mapView:(GMSMapView *)mapView didChangeMapCapabilities:(GMSMapCapabilityFlags)mapCapabilities {\n if (!(mapCapabilities & GMSMapCapabilityFlagsDataDrivenStyling)) {\n // Data-driven styling is *not* available, add a fallback.\n // Existing feature layers are also unavailable.\n }\n}\n@end\n```"]]