How to change the color of the route in Skobbler

守給你的承諾、 提交于 2019-12-01 10:48:39
SylviA

Currently the appearance of routes (the main route and the alternates) can be styled by editing the style JSON files that can be found in the SKMaps.zip archive that stores the resources. In the demo these JSON files are daystyle.json, grayscalestyle.json, nightstyle.json and outdoorstyle.json.

Here you can find a modified daystyle.json file in which the route colors have been changed. Look for comments ("//") in this file to find out which properties were modified in order to change route colors. Similar changes in the other JSON style files should be made in order to modify route colors for the rest of the map styles.

For the moment changing the route color dynamically or styling route segments differently is not currently supported in the SDK.

Alternative approach:

  • not colouring the route but colouring various road segments along the route, provided that you draw them separately. Retrieve the route information by calling routeCoordinatesForRouteWithId

    NSArray *locations = [[SKRoutingService sharedInstance] routeCoordinatesForRouteWithId:routeInformation.routeID];

Note: make sure you have set requestExtendedRoutePointsInfo to true for SKRouteSetttings before calling calculate route. And then you'll have access to the road segments, which you can draw on the map as colored Polylines.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!