---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/examples/cases/editor_icon_layout.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/examples/cases/editor_icon_layout.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# Specifying images for the polyline editor

<iframe id="LIVE-EXAMPLE" style="width:100%;height: 400px;border-radius: 8px;border: 1px solid rgba(92, 94, 102, 0.14);" frameBorder="0" src="https://yastatic.net/s3/front-maps-static/maps-front-jsapi-v2-1/examples/2/out/s3-cases/en/editor_icon_layout/index.html" allow="fullscreen"></iframe>

<a target="_blank" rel="noopener noreferrer" style="display: inline-block;margin-top: 10px;cursor: pointer;border-radius: 4px;padding: 9px 12px;background: #151515;color: white;text-decoration: none;font-weight: 500" href="https://codesandbox.io/p/sandbox/yj6q2y?file=index.html">Open in CodeSandbox</a>

<div id="references">
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ready">ready</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map">Map</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Polyline">Polyline</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.GeoObjects">map.GeoObjects</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.LineString">geometryEditor.LineString</a>
</div>
<p>
    A <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/dg/concepts/geoobjects#visual_editing">visual editor</a> is available for polylines. A link to the editor is in the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/GeoObject#editor">editor</a> field of the polyline object.
</p>
<p>
    The <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.LineString-docpage/#param-options.vertexInteractiveOptions">vertexInteractiveOptions</a> and <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.LineString-docpage/#param-options.edgeInteractiveOptions">edgeInteractiveOptions</a> options allow you to use options with postfixes for the placemark vertices and interim points linked to the current status of the vertex.
    If you don't have to change the options of the vertices and the interim placemarks depending on their condition, you should disable the corresponding option.
    The following postfixes for the placemark vertices are available:
<ul>
    <li>Hover - Options with this given postfix are used when the user hovers over a vertex with the mouse pointer.</li>
    <li>Drag - Options with this given postfix are used when the user drags a vertex.</li>
    <li>Active - Options with this given postfix are used when the context menu is open on a vertex.</li>
</ul>
    Examples of such options: vertexLayoutHover, vertexIconImageSizeActive, vertexIconImageShapeHover, etc.
</p>
<p>
    The following postfixes are available for intermediate points:
<ul>
    <li>Hover - Options with this given postfix are used when the user hovers over a placemark with the mouse pointer.</li>
    <li>Drag - Options with this given postfix are used when the user drags a placemark.</li>
</ul>
    Examples of such options: edgeLayoutHover, edgeIconImageShapeHover, etc.
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html>
        <head>
            <title>Examples. Specifying images for the polyline editor</title>
            <meta
                http-equiv="Content-Type"
                content="text/html; charset=UTF-8"
            />
            <!--
            Set your own API-key. Testing key is not valid for other web-sites and services.
            Get your API-key on the Developer Dashboard: https://developer.tech.yandex.ru/keys/
        -->
            
            
            
        </head>
        <body>
            <div id="map"></div>
        </body>
    </html>
    ```

-   editor_icon_layout.js

    ```js
    ymaps.ready(init);

    function init() {
        // Creating the map.
        var myMap = new ymaps.Map(
            "map",
            {
                center: [90, 15],
                zoom: 3,
                controls: [],
            },
            {
                searchControlProvider: "yandex#search",
            }
        );

        // Creating a polyline.
        var myPolyline = new ymaps.Polyline(
            [
                // Specifying the coordinates of the vertices.
                [70, 20],
                [70, 40],
                [90, 15],
                [70, -10],
            ],
            {},
            {
                /**
                 * Setting geo object options.
                 * Color with transparency.
                 */
                strokeColor: "#FF008888",
            }
        );

        myPolyline.editor.options.set({
            /**
             * Specifying options with postfixes linked to the current state of the vertex.
             * The layout class for placemarks on the vertices of a polyline.
             */
            vertexLayout: "default#image",
            // URL of the image file.
            vertexIconImageHref: "icons/button1.svg",
            // Dimensions of the image layer.
            vertexIconImageSize: [16, 16],
            // Offset of the image relative to the anchor point.
            vertexIconImageOffset: [-8, -8],

            // Options with this given postfix are used when the user hovers over a vertex with the mouse pointer.
            vertexLayoutHover: "default#image",
            vertexIconImageSizeHover: [28, 28],
            vertexIconImageOffsetHover: [-14, -14],

            // Options with this given postfix are used when the context menu is open on a vertex.
            vertexLayoutActive: "default#image",
            vertexIconImageHrefActive: "icons/button1-active.svg",
            vertexIconImageSizeActive: [16, 16],
            vertexIconImageOffsetActive: [-8, -8],

            // Options with this given postfix are used when the user drags a vertex.
            vertexLayoutDrag: "default#image",
            vertexIconImageHrefDrag: "icons/button1-active.svg",
            vertexIconImageSizeDrag: [16, 16],
            vertexIconImageOffsetDrag: [-8, -8],

            // Specifying options with postfixes for interim placemarks which are linked to the current state of the interim placemarks.
            edgeLayout: "default#image",
            edgeIconImageHref: "icons/button2.svg",
            edgeIconImageSize: [16, 16],
            edgeIconImageOffset: [-8, -8],

            // Options with this given postfix are used when the user hovers over an interim placemark with the mouse pointer.
            edgeLayoutHover: "default#image",
            edgeIconImageSizeHover: [28, 28],
            edgeIconImageOffsetHover: [-14, -14],

            // Options with this given postfix are used when the user drags an interim placemark.
            edgeLayoutDrag: "default#image",
            edgeIconImageHrefDrag: "icons/button2-icon.svg",
            edgeIconImageSizeDrag: [16, 16],
            edgeIconImageOffsetDrag: [-8, -8],
        });

        // Adding a line to the map.
        myMap.geoObjects.add(myPolyline);

        // Turning on the edit mode.
        myPolyline.editor.startEditing();
    }
    ```

{% endlist %}
