layerDefaults.marker.tooltip.template String|Template

The template which renders the tooltip content.

The fields which can be used in the template are:

  • location - the marker location (kendo.dataviz.map.Location instance)
  • marker - the marker instance

Setting a template disables the content option.

Example - set tooltip template

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layerDefaults: {
            marker: {
                tooltip: {
                    template: "Lon:#= location.lng #, Lat:#= location.lat #"
                }
            }
        },
        layers: [{
            type: "marker",
            locationField: "latlng",
            dataSource: {
                data: [{
                    latlng: [0, 0]
                }]
            }
        }]
    });
</script>

Example - use formatted dataItem value in the tooltip template

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "marker",
            tooltip: {
                template: "#= kendo.toString(marker.dataItem.value, 'C') #"
            },
            dataSource: {
                data: [{
                    latlng: [0, 0],
                    value: 1000
                }]
            },
            locationField: "latlng"
        }]
    });
</script>
In this article