如何更改iOS版Skobbler SDK中的visual advisor颜色

如何更改iOS版Skobbler SDK中的visual advisor颜色,ios,objective-c,skmaps,Ios,Objective C,Skmaps,我正在尝试解决如何更改iOS版Skobbler SDK导航方面的视觉建议(箭头)颜色。我想定制视觉方面的建议颜色明智 我有以下资料: let configAdvice = SKVisualAdviceConfiguration.visualAdviceColor() configAdvice.countryCode = "US" configAdvice.streetType = SKStreetType.Secondary configAdvice.routeS

我正在尝试解决如何更改iOS版Skobbler SDK导航方面的视觉建议(箭头)颜色。我想定制视觉方面的建议颜色明智

我有以下资料:

    let configAdvice = SKVisualAdviceConfiguration.visualAdviceColor()
    configAdvice.countryCode = "US"
    configAdvice.streetType = SKStreetType.Secondary
    configAdvice.routeStreetColor = UIColor.blackColor()
    configAdvice.allowedStreetColor = UIColor.blackColor()
    configAdvice.forbiddenStreetColor = UIColor.blackColor()
    //        config.routeStreetColor = [UIColor colorWithHex:color alpha:1.0];
    //        config.allowedStreetColor = [UIColor colorWithHex:color alpha:0.0f];
    //        config.forbiddenStreetColor = [UIColor colorWithHex:color alpha:0.0f];

    SKRoutingService.sharedInstance().visualAdviceConfigurations = [configAdvice]

    let settings: SKAdvisorSettings = SKAdvisorSettings()
    let currentLanguage: String = "en_us"
    settings.advisorVoice = currentLanguage
    settings.advisorType = .AudioFiles
    SKRoutingService.sharedInstance().advisorConfigurationSettings = settings
结果是:


正如你所看到的,箭头是白色的,很难看到。因此,我不确定为什么代码没有反映在视觉效果中…

视觉说明:倾听。 在SKRouteState参数中,您将找到有关以下各项的信息:

  • 当前(第一个)视觉建议的路径:currentVisualAdvicePath(如果需要彩色图像,请使用firstVisualAdviceImageWithColor)
  • 下一个(第二个)视觉建议的路径:secondaryVisualAdvicePath(如果您想要彩色图像,请使用secondVisualAdviceImageWithColor)
要设置“彩色通知”的配色方案,请使用以下设置:

以下是演示应用程序(SDKTools项目)中使用的代码:

以及:


谢谢安藤,但我以前有过类似的代码,但在视觉效果中没有反映出来。我用插图更新了问题。当显示视觉建议时-您从哪里检索?(使用带有颜色的First VisualAdviceImagewithColor而不是currentVisualAdvicePath)实际上可能我们使用的是错误的,但看起来,我们使用的是routingService(routingService:SKRoutingService!、didChangeCurrentAdviceImage adviceImage:UIImage!、LastAdvice isLastAdvice:Bool)我正在看演示swift,在那里也找不到方法firstvisualadviceImageWithColor
SKVisualAdviceConfiguration *visualAdviceColor1 = [SKVisualAdviceConfigurationvisualAdviceColor];
visualAdviceColor1.countryCode = @“DE";
visualAdviceColor1.streetType = SKStreetTypeSecondary;
visualAdviceColor1.routeStreetColor = [UIColor whiteColor];
visualAdviceColor1.allowedStreetColor = [UIColor grayColor];
visualAdviceColor1.forbiddenStreetColor = [UIColor blackColor];
[SKRoutingServicesharedInstance].visualAdviceConfigurations = @[visualAdviceColor1];
- (void)updateVisualAdviceSign {
    SKTNavigationVisualAdviceView *adviceView = self.mainView.navigationView.visualAdviceView;
    if (self.navigationInfo.firstAdvice) {
        if (self.navigationInfo.firstAdviceIsLast) {
            NSString *imageName = self.colorScheme[[SKTNavigationUtils destinationImageNameForStreetType:self.navigationInfo.nextStreetType]];
            imageName = [@"Icons/DestinationImages" stringByAppendingPathComponent:imageName];
            adviceView.signImageView.image = [UIImage navigationImageNamed:imageName];
        } else {
            SKVisualAdviceConfiguration *config = [self configurationForStreetType:self.navigationInfo.nextStreetType];
            adviceView.signImageView.image = [[SKRoutingService sharedInstance] visualAdviceImageForRouteAdvice:self.navigationInfo.firstAdvice color:config];
        }
    } else {
        adviceView.signImageView.image = nil;
    }
}
- (SKVisualAdviceConfiguration *)configurationForStreetType:(SKStreetType)streetType {
    NSString *name = [SKTNavigationUtils adviceSignColorNameForStreetType:streetType];
    uint32_t color = [self.colorScheme[name] unsignedIntValue];
    SKVisualAdviceConfiguration *config = [SKVisualAdviceConfiguration visualAdviceColor];
    config.streetType = streetType;
    config.countryCode = self.navigationInfo.currentCountryCode;
    config.routeStreetColor = [UIColor colorWithHex:color alpha:1.0];
    config.allowedStreetColor = [UIColor colorWithHex:color alpha:0.0f];
    config.forbiddenStreetColor = [UIColor colorWithHex:color alpha:0.0f];

    return config;
}