2

I am using the HereMaps SDK of Android with Premium edition. Is there any way to set the thickness of the route line? I can change the color with color & traveledColor properties of MapRoute class but I can not find any property about thickness.

enter image description here

Community
  • 1
  • 1
bkaancelen
  • 163
  • 2
  • 11

2 Answers2

0

please check MapPolyline class here "https://developer.here.com/documentation/android-premium/3.11/api_reference_java/com/here/android/mpa/mapping/MapPolyline.html",

it does set the width with setLineWidth method.

setLineWidth(int width)
Sets a line width, in pixels, for this MapPolyline, an int value within the [0..100] range. 
  • Thank you for your response but I use MapRoute in order to draw the route. How can I set the line width with the MapRoute object? – bkaancelen Jun 12 '20 at 11:20
0

If you really want to use MapRoute You can use CustomizableScheme for that :

   CustomizableScheme scheme = map.createCustomizableScheme("newCustomScheme", Map.Scheme.NORMAL_DAY);
    
    scheme.setVariableValue(CustomizableVariables.RouteStyle.ROUTESTYLE_1_WIDTH , *Width in pixels* , range);

you can check the CustomizableVariables.RouteStyle Class

if you want to use Polylines tho you can try this :

MapPolyline mp = new MapPolyline(new GeoPolyline(route.getRouteGeometry()));
 mp.setLineWidth(20);
 map.addMapObject(mp);
Ouaaqil Youssef
  • 79
  • 2
  • 10