0

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?

Konayuki
  • 674
  • 1
  • 9
  • 21

1 Answers1

3

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.

Łukasz Paczos
  • 597
  • 3
  • 9
  • Thank you very much! Interesting. I haven't got to inserting drawable yet, but to make the line appeared, I have to applied https://github.com/mapbox/mapbox-gl-native/issues/6240 and change `line-source` to `route`. – Konayuki Jan 24 '18 at 03:54
  • Oh, finally I can attach drawable, following exactly like what you've said: ...with `PropertyFactory.linePattern()` where you pass ID of an image previously added to the map via `MapboxMap#addImage()`. Thank you very much! – Konayuki Jan 24 '18 at 06:13