我正在使用带有高级版的 Android 的 HereMaps SDK。有什么方法可以设置路线的粗细吗?我可以使用 MapRoute 类的 color 和 traveledColor 属性更改颜色,但我找不到任何关于厚度的属性。
问问题
178 次
2 回答
0
如果你真的想使用 MapRoute 你可以使用 CustomizableScheme :
CustomizableScheme scheme = map.createCustomizableScheme("newCustomScheme", Map.Scheme.NORMAL_DAY);
scheme.setVariableValue(CustomizableVariables.RouteStyle.ROUTESTYLE_1_WIDTH , *Width in pixels* , range);
你可以检查CustomizableVariables.RouteStyle类
如果你想使用折线,你可以试试这个:
MapPolyline mp = new MapPolyline(new GeoPolyline(route.getRouteGeometry()));
mp.setLineWidth(20);
map.addMapObject(mp);
于 2021-05-22T23:28:42.093 回答
0
请在此处查看 MapPolyline 类“ https://developer.here.com/documentation/android-premium/3.11/api_reference_java/com/here/android/mpa/mapping/MapPolyline.html ”,
它确实使用 setLineWidth 方法设置宽度。
setLineWidth(int width)
Sets a line width, in pixels, for this MapPolyline, an int value within the [0..100] range.
于 2020-05-04T08:56:07.887 回答