Package globus.glmap

Class GLMapStyleParser

java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapStyleParser

public class GLMapStyleParser extends GLNativeObject
`GLMapStyleParser` is class to parse style and analyze result of parsing
  • Constructor Details

    • GLMapStyleParser

      public GLMapStyleParser(@Nullable GLMapStyleParser.ResourceLoadCallback callback)
      Initialize parser with resource block
      Parameters:
      callback - block that will provide resources
    • GLMapStyleParser

      public GLMapStyleParser(@NonNull android.content.res.AssetManager assetManager, @NonNull String path)
      Initialize parser with resources stored in assetManager with base path
      Parameters:
      assetManager - The AssetManager to be used while loading resources
      path - Path to folder in assets that contains Style.mapcss and images
    • GLMapStyleParser

      public GLMapStyleParser()
      Initialize parser without resources
  • Method Details

    • setOptions

      public void setOptions(@NonNull Map<String,String> options, Boolean defaultValue)
      Sets style options Possible options in default style: * Style * City - colored roads, highlights information required in the city * Outdoor - monochrome roads, colored trails * SubStyle * Hike - colored hike trails and routes * Bike - colored cycleways and routes * Car - thick roads, suitable for CarPlay navigation * Theme = Light, Dark
      Parameters:
      options - values for options
      defaultValue - value used for not set options
    • setClampZoomMask

      public void setClampZoomMask(int clampZoomMask)
      Sets mask to clamp zoom levels
      Parameters:
      clampZoomMask - clamp zoom mask
    • getAllOptions

      @Nullable public String[] getAllOptions()
      All options for @if tests found while parsing.
      Returns:
      all options found while parsing
    • getError

      @Nullable public GLMapError getError()
      Error happened while parsing
      Returns:
      error or null
    • parseNextBuffer

      public boolean parseNextBuffer(byte[] data)
      Parse next chunk of style
      Parameters:
      data - chunk of style to parse
      Returns:
      true if success
    • parseNextString

      public boolean parseNextString(@NonNull String string)
      Parse next chunk of style
      Parameters:
      string - chunk of style to parse
      Returns:
      true is success
    • finish

      @Nullable public GLMapVectorCascadeStyle finish()
      Finish parsing
      Returns:
      returns result of parsing. If error happened returned value is nil. Check error for details
    • parseFromResources

      @Nullable public GLMapVectorCascadeStyle parseFromResources()
      Append data from "Style.mapcss" in resources and finish parsing
      Returns:
      returns result of parsing. If error happened returned value is nil. Check error for details