New to Kendo UI for jQuery? Start a free 30-day trial

Layers.style.stroke

configuration

The default stroke for layer shapes. Accepts a valid CSS color string or object with detailed configuration.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape",
            style: {
                stroke: {
                    color: "green",
                    width: 4,
                    dashType: "longDashDot",
                    opacity: 0.5
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The default stroke color for layer shapes. Accepts a valid CSS color string, including hex and rgb.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape",
            style: {
                stroke: {
                    color: "green",
                    width: 4
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The default dash type for layer shapes. The following dash types are supported:

  • "dash" - a line consisting of dashes
  • "dashDot" - a line consisting of a repeating pattern of dash-dot
  • "dot" - a line consisting of dots
  • "longDash" - a line consisting of a repeating pattern of long-dash
  • "longDashDot" - a line consisting of a repeating pattern of long-dash-dot
  • "longDashDotDot" - a line consisting of a repeating pattern of long-dash-dot-dot
  • "solid" - a solid line

Default: 1

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape",
            style: {
                stroke: {
                    width: 4,
                    dashType: "longDashDot"
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The default stroke opacity (0 to 1) for layer shapes.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape",
            style: {
                stroke: {
                    width: 4,
                    opacity: 0.5
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The default stroke width for layer shapes.

Default: 1

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape",
            style: {
                stroke: {
                    width: 4
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>