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

Markers.tooltip

configuration

Kendo UI Tooltip options for this marker.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42.6977, 23.3219],
            tooltip: {
                autoHide: false,
                content: "Sofia, Bulgaria - Capital city",
                position: "top",
                showOn: "click"
            }
        }]
    });
</script>

A collection of {Animation} objects, used to change default animations. A value of false will disable all animations in the widget.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                animation: false,
                content: "Foo"
            }
        }]
    });
</script>

Specifies if the tooltip will be hidden when mouse leaves the target element. If set to false a close button will be shown within tooltip. If set to false, showAfter is specified and the showOn is set to "mouseenter" the Tooltip will be displayed after the given timeout even if the element is no longer hovered.

Default: true

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                autoHide: true,
                content: "Foo"
            }
        }]
    });
</script>

Specifies if the tooltip callout will be displayed.

Default: true

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                callout: false,
                template: "Lon:#= location.lng #, Lat:#= location.lat #"
            }
        }]
    });
</script>
Object|String|Function

The text or a function which result will be shown within the tooltip. By default the tooltip will display the target element title attribute content.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                content: function(e) {
                    var marker = e.sender.marker;
                    return marker.options.location.toString();
                }
            }
        }]
    });
</script>
<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                content: "Foo"
            }
        }]
    });
</script>

The height (in pixels) of the tooltip.

Default: Infinity

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                height: 80,
                content: "Foo"
            }
        }]
    });
</script>

Explicitly states whether content iframe should be created.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                  iframe: true,
                  content: {
                    url: "https://demos.telerik.com/kendo-ui/content/web/tooltip/ajax/ajaxContent3.html"
                  },
                  width: 220,
                  height: 280
            }
        }]
    });
</script>

The position relative to the target element, at which the tooltip will be shown. Predefined values are "bottom", "top", "left", "right", "center".

Default: "top"

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                position: "left",
                content: "Foo"
            }
        }]
    });
</script>

Specify the delay in milliseconds before the tooltip is shown. This option is ignored if showOn is set to "click" or "focus".

Default: 100

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                showOn: "mouseenter",
                showAfter: 1000,
                content: "Foo"
            }
        }]
    });
</script>

The event on which the tooltip will be shown. Predefined values are "mouseenter", "click" and "focus".

Default: "mouseenter"

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                showOn: "mouseenter",
                content: "Foo"
            }
        }]
    });
</script>

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.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                template: "Lon:#= location.lng #, Lat:#= location.lat #"
            }
        }]
    });
</script>

The width (in pixels) of the tooltip.

Default: Infinity

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "\u00A9 OpenStreetMap"
        }],
        markers: [{
            location: [42, 27],
            tooltip: {
                width: 80,
                content: "Foo"
            }
        }]
    });
</script>