Select platform: [Android](https://developers.google.com/maps/documentation/android-sdk/dds-boundaries/style-polygon.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/ios-sdk/dds-boundaries/style-polygon.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/dds-boundaries/style-polygon.md.txt "View this page for the JavaScript platform docs.")

<br />

To style the fill and stroke for a boundary polygon, use a styling closure that
accepts a [`GMSPlaceFeature`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPlaceFeature.md.txt) and returns a
[`GMSFeatureStyle`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSFeatureStyle.md.txt) to define style attributes. Then set the
style property to a styling closure, which contains styling logic.

![A diagram showing a boundary polygon
feature](https://developers.google.com/static/maps/documentation/ios-sdk/images/dds-boundary-feature.png)

> [!IMPORTANT]
> **Important:** While not required for all capabilities, styling of Places data may require integration with the [Places SDK for iOS](https://developers.google.com/maps/documentation/places/ios-sdk).

### Swift

```swift
let options = GMSMapViewOptions()
options.mapID = GMSMapID(identifier: "YOUR_MAP_ID")
options.camera = GMSCameraPosition(latitude: 20.773, longitude: -156.01, zoom: 12)
let mapView = GMSMapView(options: options)

let layer = mapView.featureLayer(of: .locality)

// Define a style with purple
let style = FeatureStyle(fill: .purple.withAlphaComponent(0.5), stroke: .purple, strokeWidth: 3.0)

// Apply the style to a single boundary.
layer.style = { ($0.placeID == "ChIJ0zQtYiWsVHkRk8lRoB1RNPo"/* Hana, HI */) ? style : nil }
```

### Objective-C

```objective-c
GMSMapViewOptions *options = [[GMSMapViewOptions alloc] init];
options.camera = [GMSCameraPosition cameraWithLatitude:20.773 longitude:-156.01 zoom:12];
options.mapID = [GMSMapID mapIDWithIdentifier:@"MAP_ID"];
GMSMapView *mapView = [[GMSMapView alloc] initWithOptions:options];

GMSFeatureLayer<GMSPlaceFeature *> *layer = [mapView featureLayerOfFeatureType:GMSFeatureTypeLocality];

// Define a style with purple fill and border.
GMSFeatureStyle *style = [GMSFeatureStyle styleWithFillColor:[[UIColor purpleColor] colorWithAlphaComponent:0.5] strokeColor:[UIColor purpleColor] strokeWidth:3.0];

// Apply the style to a single boundary.
layer.style = ^(GMSPlaceFeature *feature) {
  return [feature.placeID isEqual:@"ChIJ0zQtYiWsVHkRk8lRoB1RNPo"/* Hana, HI */] ? style : nil;
};
```