I've got the tooltip showing on click, but I cannot access any of the variables from my datasource read method in the template. I either get undefined, or errors when trying different combinations with the template.
<script id="Map_Tooltip_Template" type="text/x-kendo-template">
<p>#=latlng#</p>
</script>
4 Answers, 1 is accepted
0
Hello Adam,
The fields that can be used for the template are the location and marker. In order to set the location like you've described into the template, use the following:
Here is a Kendo UI Dojo by Progress which illustrates this approach.
You can find more information on the markers.tooltip.template configuration here in our helpful documentation.
Hope this helps!
Regards,
Patrick
Telerik by Progress
The fields that can be used for the template are the location and marker. In order to set the location like you've described into the template, use the following:
<
script
id
=
"Map_Tooltip_Template"
type
=
"text/x-kendo-template"
>
<
p
>#=location.lat##=location.lng#</
p
>
</
script
>
Here is a Kendo UI Dojo by Progress which illustrates this approach.
You can find more information on the markers.tooltip.template configuration here in our helpful documentation.
Hope this helps!
Regards,
Patrick
Telerik by Progress
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0

Max
Top achievements
Rank 2
answered on 09 Nov 2017, 09:54 PM
What if you wanted to return the name of the location not the lat and long?
0
Hello Max,
In the Map tooltip template, we can access the kendo.dataviz.map.Location instance (read more about the template here) and the fields available in it are only lat and lng; take a look at them in our API here.
The names of locations depend on the actual map providers and not Kendo UI, so they're unavailable to the tooltip. If you had a list of names and locations in a DataSource, you could through some customization show tooltips at certain positions: take a look at this sample in the Kendo UI Dojo demonstrating how it could be done.
I hope this helps!
Regards,
Eduardo Serra
Progress Telerik
In the Map tooltip template, we can access the kendo.dataviz.map.Location instance (read more about the template here) and the fields available in it are only lat and lng; take a look at them in our API here.
The names of locations depend on the actual map providers and not Kendo UI, so they're unavailable to the tooltip. If you had a list of names and locations in a DataSource, you could through some customization show tooltips at certain positions: take a look at this sample in the Kendo UI Dojo demonstrating how it could be done.
I hope this helps!
Regards,
Eduardo Serra
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Max
Top achievements
Rank 2
answered on 21 Nov 2017, 06:34 PM
Thank you that was perfect!