4

enter image description here

i record routes with my app, mostly for motorbikes, and want to color it depending on the speed at each point of the route.

basically i know how to do it in mapbox and that is the problem. since you can set a color for only one polyline, i have to split up the route in speed sections and print every route sections polyline with it's specific color, which works fine basically. problem is that i have up to 500-2000 polylines for a route. so the map crashes very easily.

i don't have that problem when i set like 5000 image annotations to the map, which i can color individually. this could be a solution but it can take up to 20 seconds to print all image annotations. any other options to make a colored route like the on in the image ?

Peter Pohlmann
  • 1,478
  • 15
  • 30

1 Answers1

0

This is not possible with out of the box mapbox polylines.

You will have to add a new layer, perform the translations and add the gradient lines yourself. This might get you started drawing the lines: https://stackoverflow.com/a/25034854/4019540

Good luck

Community
  • 1
  • 1
Thomm
  • 506
  • 5
  • 12
  • this would be a pretty hard task, since you have to sync the layer with the map. still possible ;-) – Peter Pohlmann Jun 14 '16 at 08:55
  • 1
    You can add a layer to the [RMMapOverlayView](https://github.com/adampax/titanium-mapbox/blob/master/mapbox-ios-sdk/MapView/Map/RMMapOverlayView.m), this will be transposed automatically. You will have to subclass RMMapView though to expose it. – Thomm Jun 14 '16 at 12:58