Skip to main content

Custom layers

Contents

Once a source is set and has data, a layer can reference it. Layers are used to visualize the data from a source. There are a variety of layer types including: Circle, Line, Fill and Symbol.

CircleLayer

A CircleLayer uses single coordinates from a source to display and render a circle at a location on a map. Circles can be styled with size options, coloring, opacity etc.

A more detailed example of the CircleLayer in action can be found in the Dots on a Map code example.

LineLayer

The LineLayer is used to visualize a series of coordinates as a line on the map. A line is drawn between each coordinate provided in the LineString geometry in the source.

A more detailed example of the LineLayer in action can be found in the Lines on a Map code example.

FillLayer

A FillLayer makes use of the Polygon geometry from the linked source. A shape is drawn enclosed on the map and the shape is filled in.

SymbolLayer

The SymbolLayer is used for displaying text or icons on the map. The locations for rendering are pulled from the coordinates in the source’s data. The example below shows how you can use your own custom icon on the map:

Other layers

A variety of other layers are also available for use, such as the HeatmapLayer and the FillExtrusionLayer.

Last updated August 7, 2023.
Contents