How to change the color of the route in Skobbler

前端 未结 1 1576
迷失自我
迷失自我 2021-01-15 15:26

Hello i want to change the color of the routes in skobbler.For example im doing a waze like app in android. i want to change the color of the route to red when there is a he

相关标签:
1条回答
  • 2021-01-15 16:04

    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.

    0 讨论(0)
提交回复
热议问题