Package globus.glmap
Class GLMapStyleParser
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapStyleParser
`GLMapStyleParser` is class to parse style and analyze result of parsing
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Called when GLMapView need to load some image -
Constructor Summary
ConstructorDescriptionInitialize parser without resourcesGLMapStyleParser
(android.content.res.AssetManager assetManager, String path) Initialize parser with resources stored in assetManager with base pathInitialize parser with resource block -
Method Summary
Modifier and TypeMethodDescriptionfinish()
Finish parsingString[]
All options for @if tests found while parsing.getError()
Error happened while parsingAppend data from "Style.mapcss" in resources and finish parsingboolean
parseNextBuffer
(byte[] data) Parse next chunk of styleboolean
parseNextString
(String string) Parse next chunk of stylevoid
setClampZoomMask
(int clampZoomMask) Sets mask to clamp zoom levelsvoid
setOptions
(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, DarkMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLMapStyleParser
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 resourcespath
- Path to folder in assets that contains Style.mapcss and images
-
GLMapStyleParser
public GLMapStyleParser()Initialize parser without resources
-
-
Method Details
-
setOptions
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 optionsdefaultValue
- value used for not set options
-
setClampZoomMask
public void setClampZoomMask(int clampZoomMask) Sets mask to clamp zoom levels- Parameters:
clampZoomMask
- clamp zoom mask
-
getAllOptions
All options for @if tests found while parsing.- Returns:
- all options found while parsing
-
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
Parse next chunk of style- Parameters:
string
- chunk of style to parse- Returns:
- true is success
-
finish
Finish parsing- Returns:
- returns result of parsing. If error happened returned value is nil. Check error for details
-
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
-