Ask Your Question
1

What is the method to eliminate dashed lines in React Native maps?

asked 2021-10-29 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-06 17:00:00 +0000

devzero gravatar image

To eliminate dashed lines in React Native maps, you can set the lineDashPattern property to null or an empty array ([]). This property controls the pattern of the dashed line, so setting it to null or an empty array will eliminate the dashed pattern altogether. You can do this either in the MapView.Polyline component or in the Polyline object you pass to it. For example:

<MapView>
  <MapView.Polyline
    coordinates={coordinates}
    strokeColor="#0000FF"
    strokeWidth={2}
    lineDashPattern={null}
   />
</MapView>

Or

const polyline = {
  coordinates: coordinates,
  strokeColor: "#0000FF",
  strokeWidth: 2,
  lineDashPattern: []
};

<MapView>
  <MapView.Polyline {...polyline} />
</MapView>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-10-29 11:00:00 +0000

Seen: 15 times

Last updated: Mar 06 '23