Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ declare module "react-native-maps-directions" {
* Default: "#000"
*/
strokeColor?: string;
/**
* @number
* The stroke border width to use for the path
* 0 indicates no border.
* Default: 0
*/
strokeBorderWidth?: number;
/**
* @string
* The stroke border color to use for the path.
* Default: "#FFF"
*/
strokeBorderColor?: string;
/**
* @Array
* The stroke colors to use for the path (iOS only).
Expand Down
16 changes: 15 additions & 1 deletion src/MapViewDirections.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,19 @@ class MapViewDirections extends Component {
...props
} = this.props;

const borderPolylineProps = {
...props,
strokeWidth: props.strokeBorderWidth + props.strokeWidth,
strokeColor: props.strokeBorderColor,
};

return (
<Polyline coordinates={coordinates} {...props} />
<>
{props.strokeBorderWidth &&
<Polyline coordinates={coordinates} {...borderPolylineProps} />
}
<Polyline coordinates={coordinates} {...props} />
</>
);
}

Expand Down Expand Up @@ -352,6 +363,9 @@ MapViewDirections.propTypes = {
precision: PropTypes.oneOf(['high', 'low']),
timePrecision: PropTypes.oneOf(['now', 'none']),
channel: PropTypes.string,
strokeWidth: PropTypes.number,
strokeBorderWidth: PropTypes.number,
strokeBorderColor: PropTypes.string,
};

export default MapViewDirections;