如何改变在Skobbler路由的颜色 [英] How to change the color of the route in Skobbler

查看:168
本文介绍了如何改变在Skobbler路由的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想改变skobbler.For例如即时通讯做像Android应用Waze的一个路由的颜色。我想改变为红色路线的颜色时,有在路线交通繁忙。也许有人可以帮助我在此。先谢谢了。

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 heavy traffic in the route. maybe someone can help me on this. Thanks in advance.

推荐答案

目前的路线(主要路线和候补委员)的外观可以通过编辑可以在SKMaps.zip档案中发现的风格JSON文件中的样式存储资源。在演示这些JSON文件daystyle.json,grayscalestyle.json,nightstyle.json和outdoorstyle.json。

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.

这里你可以找到一个修改daystyle.json文件在该路线的颜色已被改变。寻找在这个文件中的注释(//),以找出为了改变路线的颜色进行了修改哪些属性。在其他的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.

有关瞬间动态改变路线颜色或造型航段不同目前不支持在SDK中。

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

替代做法:


  • 不着​​色的路线,但沿途的各种着色路段,只要你单独绘制它们。
    通过调用routeCoordinatesForRouteWithId检索路由信息

  • 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 *位置= [[SKRoutingService sharedInstance]
routeCoordinatesForRouteWithId:routeInformation.routeID];

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

注意:请确认您已调用计算路线之前设置requestExtendedRoutePointsInfo为true SKRouteSetttings。然后,你将有机会获得的路段,你可以在地图有色折线上绘制。

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.

这篇关于如何改变在Skobbler路由的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆