diff --git a/index.d.ts b/index.d.ts index b19991a..3e0a523 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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). diff --git a/src/MapViewDirections.js b/src/MapViewDirections.js index 8e05906..00eecae 100644 --- a/src/MapViewDirections.js +++ b/src/MapViewDirections.js @@ -307,8 +307,19 @@ class MapViewDirections extends Component { ...props } = this.props; + const borderPolylineProps = { + ...props, + strokeWidth: props.strokeBorderWidth + props.strokeWidth, + strokeColor: props.strokeBorderColor, + }; + return ( - + <> + {props.strokeBorderWidth && + + } + + ); } @@ -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;