-
Notifications
You must be signed in to change notification settings - Fork 4
Scalebar
Andreas Fast edited this page Mar 29, 2016
·
4 revisions
Place a scale bar on your map to provide a general idea of distances.
Currently we only support a "bar" scale bar with the following options:
-
unitCan be meters, km, miles or feet -
position: {x: 40, y: 40}Where on the png/pdf to place the scalebar -
size: {width: 200, height: 40}Size in pixels for the scale bar. -
padding: {top: 0, right: 0, bottom: 0, left: 0}this allows to separate the border from the scale bar itself -
bar_heighthow tall to draw the bar -
background_colorColor to use for the scale bar background, ImageMagick is used to anything it accepts including 'transparent', or hex. -
background_opacityif you want the background color to include some transparency. -
text_stylestyling options:-
fill_colorbackground color -
colorthe text color. -
fontthe font to use, make sure it is installed on your system. -
pointsizethe size of the text. -
gravityWhere on the box to align the text.
-
scalebar: {
unit: 'meters', # meters, km, miles, feet
position: {x: 500, y: 550},
size: {width: 200, height: 40},
padding: {top: 5, right: 5, bottom: 5, left: 5},
bar_height: 10,
background_color: 'black',
background_opacity: 0.4,
text_style: {
fill_color: '#ffffff',
color: '#000000',
font: 'Arial',
pointsize: '16',
gravity: 'NorthWest'
}
}