[Yandex Cloud documentation](../../index.md) > [Yandex DataLens](../index.md) > Charts > [Visualization reference](index.md) > Map > Polyline map

# Polyline map ![](../../_assets/datalens/polyline-map.svg) in Yandex DataLens

A polyline map is a type of geolayer on a **Map** chart that lets you draw polylines on the map. A polyline consists of points connected in a certain order. 

A polyline map is used, for example, to show the path of a moving object.

  ![polyline-map-chart](../../_assets/datalens/visualization-ref/polyline-map-chart/polyline-map-chart.png =800x)

To build a polyline map, you need the following data:

* Coordinates of line points of the [Geopoint](../dataset/data-types.md#geopoint) data type. Each point of each polyline must be stored in a dataset as a separate row.
* A field or a set of fields to group points into lines (each line's ID).
* A field to sort the order of points in each line (such as a timestamp or point number).

You can color polyline segments in one of the following ways:

* In a gradient by measure (for a example, an average speed in a point).

  
  {% cut "Example" %}
  
  ![polyline-map-chart-2](../../_assets/datalens/visualization-ref/polyline-map-chart/polyline-map-chart-2.png)

  {% endcut %}
  

* In discrete colors by dimension (for example, by trip name).

  
  {% cut "Example" %}

  ![polyline-map-color-dimensions](../../_assets/datalens/visualization-ref/polyline-map-chart/polyline-map-color-dimensions.png)

  {% endcut %}


## Wizard sections {#wizard-sections}

Wizard<br/> section| Description
----- | ----
Polylines	(Geopoints) | Measure of the [Geopoint](../dataset/data-types.md#geopoint) type
Measures	| Measure. The value displayed when you hover over a point.
Grouping	| Dimension. Defines a group of points forming a polyline.
Colors	| Dimension or measure. Affects the intensity of line segment fill. A segment is filled in from the originating point.
Order	| Dimension. Defines the order for connecting points within a group.
Layer filters	| Dimension or measure. Used as a filter for the current layer.
Filters	| Dimension or measure. Used as a filter for the entire chart.

## Creating a polyline map {#create-diagram}

To create a polyline map:


{% note warning %}

If you use the new DataLens object model with [workbooks and collections](../workbooks-collections/index.md):


1. Go to the DataLens [home page](https://datalens.ru/?skipPromo=true). In the left-hand panel, select ![collections](../../_assets/console-icons/rectangles-4.svg) **Collections and workbooks**.


1. Open the workbook, click **Create** in the top-right corner, and select the object you need.

Follow the guide from step 4.

{% endnote %}


1. Go to the DataLens [home page](https://datalens.ru/?skipPromo=true).
1. In the left-hand panel, select ![chart](../../_assets/console-icons/chart-column.svg) **Charts**.
1. Click **Create chart** → **Chart**.
1. At the top left, click ![image](../../_assets/console-icons/circles-intersection.svg) **Select dataset** and specify the dataset to visualize. If you do not have a dataset, [create one](../dataset/create-dataset.md#create).
1. Select **Map** for the chart type.
1. Select the **Polylines (Geopoints)** layer type.
1. Drag a dimension of the [Geopoint](../dataset/data-types.md#geopoint) type from the dataset to the layer type selection section.
1. Specify a group of points that defines polylines. Move the measure to the **Grouping** section.
1. Define the order for connecting points within the group. Move the measure to the **Order** section.
1. Color the line on the map. Move the measure or dimension to the **Colors** section.

{% note info %}
              
You can show a particular area on the map using the **Center** and **Scale** [settings](../concepts/chart/settings.md#common-settings).
          
{% endnote %}

You can also:

* Add, rename, and delete a layer.
* Apply a filter to the entire chart or one layer.

## Recommendations {#recomendations}

* Reduce the number of route points at the source level if there are too many of them. To do this, use a chart-level filter. This will speed up map loading and rendering.
* Use the [MAVG](../function-ref/MAVG.md) moving average function to smooth measure outliers of individual points/sections. 

  For example, when building a line representing average speed using the `MAVG([speed],2,2)` function, the speed measure values are averaged out in the current point, as well as two points before and two points after it. As a result, the color gradient changes more smoothly.

#### Useful links {#see-also}

* [Creating a dashboard in Yandex DataLens](../operations/dashboard/create.md)
* [Adding a chart to a dashboard in Yandex DataLens](../operations/dashboard/add-chart.md)
* [Adding a selector to a dashboard in Yandex DataLens](../operations/dashboard/add-selector.md)