Konayuki
Konayuki

Reputation: 674

How to put drawable for polyline pattern in Mapbox?

Just like for marker where we can put drawable for its icon, such as with Marker's .SetIcon(), how to do the same with Mapbox's polyline?

I've searched Google but, CMIIW, seems like there isn't a way to do that yet? Some links I think are related:

  1. Github - Dotted Polyline on Android
  2. Runtime Styling API

Any suggestion?

Upvotes: 0

Views: 1058

Answers (1)

Łukasz Paczos
Łukasz Paczos

Reputation: 607

Unfortunately, Polyline doesn't support custom patterns. What I'd suggest is using LineLayer with PropertyFactory.linePattern() where you pass ID of an image previously added to the map via MapboxMap#addImage().

Here is an example activity that uses LineLayer.

Upvotes: 3

Related Questions