itemsArray
An array of the markers currently loaded in this layer.
Example
<div id="map"></div>
<script>
$("#map").kendoMap({
layers: [{
type: "marker",
dataSource: [
{ latlng: [42.3601, -71.0589], name: "Boston" },
{ latlng: [40.7128, -74.0060], name: "New York" },
{ latlng: [34.0522, -118.2437], name: "Los Angeles" }
],
locationField: "latlng"
}]
});
var map = $("#map").data("kendoMap");
var markerLayer = map.layers[0];
// Access the markers currently loaded in the layer
console.log("Number of markers:", markerLayer.items.length);
console.log("First marker:", markerLayer.items[0]);
// Log all marker locations
markerLayer.items.forEach((marker, index) => {
console.log(`Marker ${index + 1}:`, marker.location());
});
</script>
In this article