Results 1 to 3 of 3

Thread: Changing Visual Advice icons

  1. #1
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41

    Idee Changing Visual Advice icons

    Hi!

    Is it possible to change visual advice icons? I mean, at least change some colors etc.?

    I found this post: http://forum.skobbler.com/showthread...vice-file-list but there's no solution

    I guess this is described like some json style or something like that?! Can You point that where should I edit info to change those properties?

    thanks

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    The visual advices are generated dynamically, based on the real road geometry. You can customize the background & colours via:

    iOS: To listen for/intercept navigation events (more details can be found here):
    • Visual instructions – listen to didChangeFirstVisualAdvice
    • Inside the SKRouteState parameter you will find information about the:
    • Path to the current (first) visual advice: currentVisualAdvicePath (if you want a coloured image use firstVisualAdviceImageWithColor)
    • Path to the next (second) visual advice: secondaryVisualAdvicePath (if you want a coloured image use secondVisualAdviceImageWithColor)
    • Instructions (as text) for the first advice: currentAdviceInstruction
    • Instructions (as text) for the second advice: nextAdviceInstruction



    Android:
    To listen for/intercept navigation events you will need to implement SKNavigationListener (more details can be found here):
    • Visual instructions – listen to onVisualAdviceChanged
    • Inside the SKNavigationState parameter you will find information about the:
    • Path to the current (first) visual advice: getCurrentAdviceVisualAdviceFile
    • Path to the next (second) visual advice: getNextAdviceVisualAdviceFile
    • Instructions (as text) for the first advice: getAdviceInstruction
    • To modify the colour of the visual advices, use something like:



    Code:
    public void onVisualAdviceChanged(final boolean firstVisualAdviceChanged, final boolean secondVisualAdviceChanged,
    final SKNavigationState navigationState) {
              
    if (firstVisualAdviceChanged) {
                   SKCrossingDescriptor currentImageCrossingDescriptor =
    navigationState.getFirstCrossingDescriptor();
                   String currentVisualAdviceImage = "[base path of map resouces]/current_advice_image.png";
                   final SKVisualAdviceColor firstVisualAdviceColor = new SKVisualAdviceColor();
                   firstVisualAdviceColor.setAllowedStreetColor(new
    float[]{0.2f, 0.2f, 0.2f, 0.4f});
                   firstVisualAdviceColor.setForbiddenStreetColor(new
    float[]{0.2f, 0.2f, 0.2f, 0.7f});
                   firstVisualAdviceColor.setRouteStreetColor(new
    float[]{0.2f, 0.2f, 0.2f, 1});
                  
    SKNavigationManager.getInstance().renderVisualAdviceImage(currentImageCrossingDescriptor,
       currentVisualAdviceImage, firstVisualAdviceColor);
                  
    }

  3. #3
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Thanks, Adela! This works great

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •