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
Karlsruhe_day Karlsruhe_night
Liverpool_day.ini Liverpool_night.ini
Liverpool_day Liverpool_night
London_day.ini London_night.ini
London_day London_night

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, see
COLURBAN color for the town area
COLINDUSTRY color for an industrial zone
COLWOOD color for a forrest
COLPARK color for a park
COLSKY color for the sky
COLHORIZON color of the horizont

Global configuration

The configuration file lies in the data directory you specified in while initializing the SDK and is called „maprenderer.ini“. If this file is not available, default values will be used for all parameters normally 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
COLFORESTROAD color for a forest road
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
COLFORESTROAD_INNER inside color for a forest road
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
COLTMCINNERONROUTE inside color for a traffic jam on-route
COLTMCOUTERONROUTE 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
COLMANOVERARROWBACK shadow color for a manoeuvre arrow
COLMANOVERARROWFORE color of a manoeuvre arrow
COLWATER color for a lake, river, see
COLURBAN color for the town area
COLINDUSTRY color for an industrial zone
COLWOOD color for a forrest
COLPARK color for a park
COLSKY color for the sky
COLHORIZON color of the horizont
COLBORDER color of borders
COLTRUCKERSEGMENTS color of segments that are restricted for trucks
COLCCP1 polygon fill color for some of the CCP’s 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
Scale10Threshold
Scale100Threshold

[3D]

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

Parameter Description
3DViewAngle

[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