<!--
{
  "availability" : [
    "MapKit JS: 5.45.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/StyleConstructorOptions/lineGradient",
  "metadataVersion" : "0.1.0",
  "role" : "Interface Property",
  "symbol" : {
    "kind" : "Interface Property",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "structp/mapkit.StyleConstructorOptions/lineGradient"
  },
  "title" : "lineGradient"
}
-->

# lineGradient

The gradient to apply along the line.

```
lineGradient?: LineGradient;
```

## Discussion

If a style has both [`strokeColor`](/documentation/MapKitJS/Style/strokeColor) and [`lineGradient`](/documentation/MapKitJS/Style/lineGradient) definitions, [`lineGradient`](/documentation/MapKitJS/Style/lineGradient) takes precedence and displays. If you don’t define a color at the start or end location within the gradient, MapKit JS uses the style’s [`strokeColor`](/documentation/MapKitJS/Style/strokeColor).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)