Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface LayerStyle

This is an interface to describe how certain features should be rendered within a layer.

example
{
 styleGroups: {
   "myLineStyle": [
     {zIndex: 0, type: "Line", opacity: 1, stroke: "#BE6B65", strokeWidth: 16},
     {zIndex: 1, type: "Line", opacity: 1, stroke: "#E6A08C", strokeWidth: 12},
     {zIndex: 2, type: "Text", fill: "#000000", "textRef": "properties.name"}
   ]
 },
 assign: function(feature: Feature, zoomlevel: number){
   return "myLineStyle";
 }
}

Hierarchy

  • LayerStyle

Index

Properties

assign

assign: (feature: Feature, zoomlevel: number) => string | null | undefined

The function returns a key that is defined in the styleGroups map. This function will be called for each feature being rendered by the display. The display expects this method to return the key for the styleGroup of how the feature should be rendered for the respective zoomlevel.

param

the feature to which style is applied

param

the zoomlevel of the tile the feature should be rendered in

returns

the key/identifier of the styleGroup in the styleGroupMap, or null/undefined if the feature should not be rendered.

Type declaration

    • (feature: Feature, zoomlevel: number): string | null | undefined
    • Parameters

      • feature: Feature
      • zoomlevel: number

      Returns string | null | undefined

Optional backgroundColor

backgroundColor: Color | StyleZoomRange<Color> | ((zoomlevel: number) => Color)

the color for the background of the layer

styleGroups

styleGroups: {}

This object contains key/styleGroup pairs. A styleGroup is an array of Style, that exactly defines how a feature should be rendered.

Type declaration

  • [key: string]: Array<Style>

Generated using TypeDoc