This is a migrated thread and some comments may be shown as answers.

how to add tooltips for countries programly ?

3 Answers 220 Views
Map
This is a migrated thread and some comments may be shown as answers.
Congyuan
Top achievements
Rank 1
Congyuan asked on 11 Feb 2015, 09:31 PM
According to this demo. http://demos.telerik.com/kendo-ui/map/geojson
Is there any method I can call to display the numbers in the tooltips for each countries area program?

 The requirements of my project is like when end user selected row in the grid, it should highlight the country area and show the number in the tool tip on map.
See the attachment.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 13 Feb 2015, 03:38 PM
Hi Congyuan,

I can suggest that you try the following steps:
    1) Bind the Grid and Map controls to the same GeoJSON data source.
    2) Add information to the GeoJSON data about the location of the tooltips.
    3) Attach to the shapeCreated event of Map and where you can create the marker with the desired location and text from the data source. Here you can also add a custom id to the element.
     4) Attach to the change event of the grid where you can find the map's marker by the custom shape id and display the tooltip
     5) Use CSS in order to hide the markers.

I have created such an integration for the first two countries from the GeoJSON data source in the attachment. Please give it a try and then tell me how it goes.

Regards,
Danail Vasilev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Accepted
Danail Vasilev
Telerik team
answered on 13 Feb 2015, 05:10 PM
Hello Congyuan,

You may also find useful a cleaner solution here with a custom tooltip, that doesn't require data source manipulations.

Regards,
Danail Vasilev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Congyuan
Top achievements
Rank 1
answered on 13 Feb 2015, 06:02 PM
Cool thanks you soooooooooooo much. it's realy helpful
You are genius ;)
Tags
Map
Asked by
Congyuan
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Congyuan
Top achievements
Rank 1
Share this question
or