add

Adds a Marker to the layer.

Example

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "marker",
            dataSource: [
                { latlng: [42.3601, -71.0589], name: "Boston" }
            ],
            locationField: "latlng"
        }]
    });

    var map = $("#map").data("kendoMap");
    var markerLayer = map.layers[0];
    
    // Create a new marker
    var newMarker = new kendo.dataviz.map.Marker([40.7128, -74.0060], {
        title: "New York"
    });
    
    // Add the marker to the layer
    markerLayer.add(newMarker);
    
    console.log("Marker added. Total markers:", markerLayer.items.length);
</script>

Parameters

marker kendo.dataviz.map.Marker

The Marker instance to add.

In this article
add
Not finding the help you need?
Contact Support