Line dash pattern symbol (polyline helper)

In this example, we will explore the process of incorporating a line layer with a dash pattern symbol into the map by utilizing the polyline layer helper. You can access the sample data by downloading the Amphitheater Lake trail sample data.

By following this approach, we can successfully incorporate a visually appealing dash pattern symbol into our line layer, enhancing its overall appearance and functionality on the map.

NPM module setup


npm install --save @maptiler/sdk
import { Map, MapStyle, config, helpers } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = new Map({
    container: 'map',
    zoom: 14,
    center: [-110.75926, 43.72683],
    style: MapStyle.OUTDOOR
});

map.on('load', async function () {
  await helpers.addPolyline(map, {
    data: 'YOUR_MAPTILER_DATASET_ID_HERE',
    outline: true,
    lineDashArray: "___  _  ",
    lineColor: "#F1175D"
  });
});
Line layer (polyline helper)

Line layer (polyline helper)

Examples

Add minimal line layer using MapTiler polyline helper.

Add a KML Line layer (polyline helper)

Add a KML Line layer (polyline helper)

Examples

Add KML line layer using MapTiler polyline helper.

Line outline glow blur symbol (polyline helper)

Line outline glow blur symbol (polyline helper)

Examples

Add glowing outline to line layer using helper.

Show line data from GeoJSON on the map

GeoJSON line layer

Tutorials

Add a GeoJSON line overlay to the map application.

Was this helpful?