Layer properties

You can use layer properties to control global characteristics of the map, such as showing/hiding specific layers, opacity or relative sizes of all markers.

See below for the list of properties, click the links to alter the properties.

For complete documentation of the available layer properties, see:

  • Common layer API,
  • Elevations layer API,
  • Markers layer API,
  • Labels layer API,
  • Outline layer API.

Marker layers have the following properties:

  • visible – if false, hide the layer.

    Set: true false

  • markerSizeMultiplier – the multiplier to apply on top of the size of individual markers. This property is useful when defining an extra layer to display hover or selection highlights to make the highlighted markers slightly larger than the unaffected ones.

    Set: 6.0 12.0 18.0 24.0

  • opacity – global opacity of all markers on the layer, applied on top of opacities of individual markers.

    Set: 0.0 0.3 0.6 1.0

  • markerFillOpacity – opacity of the inner part of all markers on the layer.

    Set: 0.0 0.3 0.6 1.0

  • markerBorderOpacity – opacity of the outer part of all markers on the layer.

    Set: 0.0 0.3 0.6 1.0

  • markerBorderWidth – size of the outer part of the marker, relative to the marker as a whole.

    Set: 0.0 0.3 0.6 1.0


The elevations layer has the following properties:

  • opacity – opacity of the elevations layer.

    Set: 0.0 0.6 0.8 1.0

  • saturation – saturation of the elevations layer.

    Set: -0.5 -0.25 0.0 0.25 0.5

  • lightness – lightness of the elevations layer.

    Set: -0.5 -0.25 0.0 0.15 0.5

  • contourWidth – width of the contours on the elevation layer.

    Set: 0.0 0.5 0.8 2.0

  • contourOpacity – opacity of the contours on the elevation layer.

    Set: 0.0 0.2 0.5 1.0

  • lightIntensity – the intensity of light to use for hill shading of the map.

    Set: 0.0 0.1 0.2 0.5

  • lightAzimuth – controls the direction of the light used for hill shading of the map. Value is in radians and gives the direction the light comes from, where 0 is the West.

    Set: N NW W SW S SE E NE

  • maxRadius – determines how much "land" each elevation point generates. The larger the value, the more "land" is generated. The smaller the value, the more island-like the map appears.

    Set: 0.1 0.2 0.5 1.0 2.0

  • elevationPow – the power to which the elevation value is raised. Values lower than 1.0 generate more "land", while values larger than 1.0 generate more "islands".

    Set: 0.25 0.50 1.00 1.50 2.00

  • refreshMargin – caches the heightmap in map space and reuses it across pan and zoom. The value is how much larger than the view the cached region is rendered (0.5 = 50% bigger); that extra coverage is the room you can pan and zoom into before the heightmap is refreshed. Larger margins refresh less often but soften the field more between refreshes (watch the map soften as you zoom in, then snap sharp at a refresh). 0 turns the cache off (the heightmap is refreshed every frame).

    Set: 0.0 0.25 0.5 1.0


The labels layer has the following properties:

  • opacity – opacity of all the labels on the map.

    Set: 0.0 0.6 0.8 1.0

  • labelFontSize – font size to use to draw all labels in the layer.

    Set: 8px 12px 16px 20px 24px 32px

  • labelFontFamily – font family to use to draw all labels in the layer.

    Set: sans-serif serif system-ui monospace

  • labelFontStyle – font style to apply when drawing all labels in the layer.

    Set: normal italic

  • labelFontWeight – font weight to apply when drawing all labels in the layer.

    Set: normal bold 300

  • labelFontVariant – font variant to apply when drawing all labels in the layer.

    Set: normal small-caps

  • labelDensity – controls how tightly labels pack on the map. 1.0 is the default spacing; values above 1.0 shrink the collision halo so more labels fit; values below 1.0 grow it so fewer labels show.

    Set: 0.5 1 1.5 2 3

  • labelColor – fill color used for every label.

    Set: dark blue red

  • labelCollisionModel – how labels are packed for visibility. per-word reserves one box per word (tighter packing); per-label-box reserves a single box around the whole label.

    Set: per-word per-label-box

  • labelMinSizeScale – minimum per-point size multiplier. Per-point labelSize values smaller than this are clamped up.

    Set: 0.25 0.5 1.0

  • labelShadowSize – strength of the drop-shadow under labels. 0 disables it; larger values produce a wider, more opaque shadow.

    Set: 0 2 4 8

  • labelShadowColor – color of the drop-shadow under labels.

    Set: black blue red


All code that changes the various layer properties is included directly in this HTML page. View the page source to examine the code.