Skip to content

Map Styling

The look and feel of a SDK MapView can be fully customized. You can choose to set the colors via a global configuration file or you can load map designs dynamically for day and night mode.

Dynamically load map designs

If you want to use your own map colors, you can load your own color definition files with MapView.setMapDesign(). Our tutorial comes with some example color definitions for day and night mode.

Karlsruhe_day.ini Karlsruhe_night.ini
Liverpool_day.ini Liverpool_night.ini
London_day.ini London_night.ini

The color definitions are ini files with a [Colors] section and several color parameters. Colors are defined in RGB format, namely r,g,b, where r is red, g is green, and b is blue. r,g,b each take values in the range 0 to 255.

The [Colors] section can define the following parameters:

Parameter Description
COLMAPBACK Color for the map background
COLSTREET0 Color for the outside contour of a motorway
COLSTREET1 Color for the outside contour of a national road
COLSTREET2 Color for the outside contour of a motorway slip road
COLSTREET3 Color for the outside contour of a country road
COLSTREET4 Color for the outside contour for a fast urban road
COLSTREET5 Color for the outside contour for a normal urban road
COLSTREET6 Color for the outside contour of a ferry
COLPEDESTRIAN Color for the outside contour of a pedestrian zone/residential area
COLSTREET0_INNER Inside color for a motorway
COLSTREET1_INNER Inside color for a national road
COLSTREET2_INNER Inside color for a motorway slip road
COLSTREET3_INNER Inside color for a country road
COLSTREET4_INNER Inside color for a fast urban road
COLSTREET5_INNER Inside color for a normal urban road
COLSTREET6_INNER Inside color for a ferry
COLPEDESTRIAN_INNER Inside color for a pedestrian zone/residential area
COLROUTEINNER Inside color for a route trace
COLROUTEOUTER Outside color for a route trace
COLROUTEINNER_TARGETAREA Inside color for a route trace in a target area
COLROUTEOUTER_TARGETAREA Outside color for a route trace in a target area
COLROUTEINNER_ECOTAXE Inside colorfor a traffic truck toll on-route
COLROUTEOUTER_ECOTAXE Outside colorfor a traffic truck toll on-route
COLROUTEINNER_TOLL Inside colorfor a traffic toll on-route
COLROUTEOUTER_TOLL Outside colorfor a traffic toll on-route
COLTMCINNER Inside color for a traffic jam on-route
COLTMCOUTER Outside color for a traffic jam on-route
COLTMCINNEROFFROUTE Inside color for a traffic jam off-route
COLTMCOUTEROFFROUTE Outside color for a traffic jam off-route
COLTRUCKERSEGMENTS Color of segments that are restricted for trucks
COLMANOVERARROWBACK Shadow color for a maneuver arrow
COLMANOVERARROWFORE Color of a maneuver arrow
COLWATER Color for a lake, river, sea
COLURBAN Color for the town area
COLINDUSTRY Color for an industrial zone
COLWOOD Color for a forest
COLPARK Color for a park
COLSKY Color for the sky
COLHORIZON Color of the horizon

Global configuration

The configuration file resides in the data directory you specified while initializing the SDK and is called „maprenderer.ini“. If this file is not available, default values will be used for all parameters included in maprenderer.ini. The following headings will describe the section names for the particular entries.

[Colors_Day] / [Colors_Night]

Colors are defined in RGB format, namely r,g,b, where r is red, g is green, and b is blue. r,g,b each take values in the range 0 to 255. Two sections are included in the file maprenderer.ini: [Colors_Day] for the day view and [Colors_Night] for the night view. Both sections can define the following parameters:

Parameter Description
COLMAPBACK Color for the map background
COLSTREET0 Color for the outside contour of a motorway
COLSTREET1 Color for the outside contour of a national road
COLSTREET2 Color for the outside contour of a motorway slip road
COLSTREET3 Color for the outside contour of a country road
COLSTREET4 Color for the outside contour for a fast urban road
COLSTREET5 Color for the outside contour for a normal urban road
COLSTREET6 Color for the outside contour of a ferry
COLPEDESTRIAN Color for the outside contour of a pedestrian zone/residential area
COLSTREET0_INNER Inside color for a motorway
COLSTREET1_INNER Inside color for a national road
COLSTREET2_INNER Inside color for a motorway slip road
COLSTREET3_INNER Inside color for a country road
COLSTREET4_INNER Inside color for a fast urban road
COLSTREET5_INNER Inside color for a normal urban road
COLSTREET6_INNER Inside color for a ferry
COLPEDESTRIAN_INNER Inside color for a pedestrian zone/residential area
COLROUTEINNER Inside color for a route trace
COLROUTEOUTER Outside color for a route trace
COLROUTEINNER_TARGETAREA Inside color for a route trace in a target area
COLROUTEOUTER_TARGETAREA Outside color for a route trace in a target area
COLROUTEINNER_ECOTAXE Inside colorfor a traffic truck toll on-route
COLROUTEOUTER_ECOTAXE Outside colorfor a traffic truck toll on-route
COLROUTEINNER_TOLL Inside colorfor a traffic toll on-route
COLROUTEOUTER_TOLL Outside colorfor a traffic toll on-route
COLTMCINNER Inside color for a traffic jam on-route
COLTMCOUTER Outside color for a traffic jam on-route
COLTMCINNEROFFROUTE Inside color for a traffic jam off-route
COLTMCOUTEROFFROUTE Outside color for a traffic jam off-route
COLTRUCKERSEGMENTS Color of segments that are restricted for trucks
COLMANOVERARROWBACK Shadow color for a maneuver arrow
COLMANOVERARROWFORE Color of a maneuver arrow
COLWATER Color for a lake, river, sea
COLURBAN Color for the town area
COLINDUSTRY Color for an industrial zone
COLWOOD Color for a forest
COLPARK Color for a park
COLSKY Color for the sky
COLHORIZON Color of the horizon
COLBORDER Color of borders
COLCCP1 Polygon fill color for some of the CCPs polygons
COLCCP2 Polygon fill color for the remaining polygons of the CCP
COLCCPFILL Fill color for the CCP’s surrounding circle

[Levelling]

Defines upon which zoomlevel the different renderlevels will be shown, and which street categories are shown in the particular level (all values are in merc/pix).

Parameter Description
Scale1Treshhold The zoom level to switch from level 1 to level 10
Scale10Threshold The zoom level to switch from level 10 to level 100
Scale100Threshold The zoom level to switch from level 100 to level 1000

[3D]

In 3D mode the angle of view will be set by

Parameter Description
3DViewAngle The view angle in degrees

[Details3D]

The following parameters are used to tune the behaviour of the renderer in 3d mode. Zoom levels can be defined up to which the following three street categories are shown. When this zoom level is reached, the streets with the corresponding category are faded out

Parameter Description
3dScaleForMaxCat3 Specifies the zoom factor up to which all streets are shown. If this zoom factor is exceeded, only streets of category 3 (or lower) are shown.
3dScaleForMaxCat2 Specifies the zoom factor between when only streets of category 2 (or lower) are shown
3dScaleForMaxCat1 Specifies the zoom factor between when only streets of category 1 (or lower) are shown

Restriction: 3dScaleForMaxCat1 > 3dScaleForMaxCat2 > 3dScaleForMaxCat3

A similar mechanism is implemented for the visualization of truck restriction icons

Parameter Description
3dScaleForMaxCat3Icons If the current scale is greater or equal to the specified scale and the street category is greater than three, then no icons are drawn.
3dScaleForMaxCat2Icons If the current scale is greater or equal to the specified scale and the street category is greater than two, then no icons are drawn.
3dScaleForMaxCat1Icons If the current scale is greater or equal to the specified scale and the street category is greater than one, then no icons are drawn.

Restriction: 3dScaleForMaxCat1Icons > 3dScaleForMaxCat2Icons > 3dScaleForMaxCat3Icons

[Details2D]

In 2D mode the following parameter can be configured

Parameter Description
2dMaxIconScale Maximum scale for truck restriction icons in 2D mode

[CCPLook]

The look of the CCP (current car position) can be configured via three parameters

Parameter Description
ShowSurroundingCircle Specifies if the surrounding circle should be shown.
CircleFillOpacity Specifies the opacity of the fill color of the surrounding circle. Valid values range from 0 to 31. 0 is opaque, 31 is fully transparent.
CCPScaleFactor Specifies the scale factor of the CCP and its surrounding circle. 100 is original size, 50 is half size, 200 is double size, …

[Renderer]

General defintions for rendering

Parameter Description
IncreaseStreetnameLabels Increase the number of streetname labels Valid values are 0: don’t increase, 1: increase (default is 0)
EnhanceRenderPerformance Render faster by fading out streets earlier and rendering less details Valid values are 0: render higher details, 1: render less details (default is 1)

Example

In the example below one can see the default settings in the maprenderer.ini

[Colors_Day]
COLMAPBACK=248,252,192
COLSTREET0=248,0,0
COLSTREET1=0,0,0
COLSTREET2=104,104,104
COLSTREET3=200,120,120
COLSTREET4=128,128,128
COLSTREET5=128,128,128
COLSTREET6=128,128,128
COLPEDESTRIAN=200,220,240
COLSTREET0_INNER=248,252,0
COLSTREET1_INNER=248,0,0
COLSTREET2_INNER=248,244,48
COLSTREET3_INNER=248,244,48
COLSTREET4_INNER=249,249,187
COLSTREET5_INNER=248,252,248
COLSTREET6_INNER=248,252,248
COLPEDESTRIAN_INNER=200,220,240
COLROUTEINNER=0,252,248
COLROUTEOUTER=0,0,248
COLROUTEINNER_TARGETAREA=0,255,0
COLROUTEOUTER_TARGETAREA=0,128,0
COLTMCINNER=248,252,248
COLTMCOUTER=248,4,0
COLTMCINNEROFFROUTE=148,252,248
COLTMCOUTEROFFROUTE=148,4,0
COLMANOVERARROWBACK=0,0,0
COLMANOVERARROWFORE=0,252,0
COLWATER=128,200,232
COLURBAN=248,200,144
COLINDUSTRY=224,228,224
COLWOOD=160,204,144
COLPARK=120,192,48
COLSKY=80,100,248
COLHORIZON=208,212,208
COLTRUCKERSEGMENTS=255,128,0
COLCCP1=255,0,0
COLCCP2=128,0,0
COLCCPFILL=255,255,255

[Colors_Night]
COLMAPBACK=0,0,0
COLSTREET0=176,0,0
COLSTREET1=32,32,32
COLSTREET2=176,0,0
COLSTREET3=200,120,120
COLSTREET4=64,64,64
COLSTREET5=64,64,64
COLSTREET6=64,64,64
COLPEDESTRIAN=96,108,120
COLSTREET0_INNER=224,180,0
COLSTREET1_INNER=176,0,0
COLSTREET2_INNER=224,180,0
COLSTREET3_INNER=224,180,0
COLSTREET4_INNER=216,108,0
COLSTREET5_INNER=120,124,120
COLSTREET6_INNER=120,124,120
COLPEDESTRIAN_INNER=96,108,120
COLROUTEINNER=192,192,192
COLROUTEOUTER=0,0,88
COLROUTEINNER_TARGETAREA=255,0,0
COLROUTEOUTER_TARGETAREA=127,0,0
COLTMCINNER=248,252,248
COLTMCOUTER=248,4,0
COLMANOVERARROWBACK=0,0,0
COLMANOVERARROWFORE=0,124,0
COLWATER=40,68,160
COLURBAN=72,72,72
COLINDUSTRY=128,0,0
COLWOOD=0,80,0
COLPARK=0,88,0
COLSKY=24,112,208
COLHORIZON=176,148,176
COLTRUCKERSEGMENTS=168,84,0
COLCCP1=255,0,0
COLCCP2=128,0,0
COLCCPFILL=255,255,255

[Details3D]
3dScaleForMaxCat3=4.0f
3dScaleForMaxCat2=5.0f
3dScaleForMaxCat1=6.0f
3dScaleForMaxCat3Icons=4.0f
3dScaleForMaxCat2Icons=5.0f
3dScaleForMaxCat1Icons=6.0f

[Details2D]
2dMaxIconScale=5.0f

[CCPLook]
ShowSurroundingCircle=1
CircleFillOpacity=15
CCPScaleFactor=100

[Renderer]
IncreaseStreetnameLabels=0
EnhanceRenderPerformance=1