how to add tooltips for countries programly ?

4 posts, 1 answers
  1. Congyuan
    Congyuan avatar
    32 posts
    Member since:
    Nov 2011

    Posted 11 Feb 2015 Link to this post

    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.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 13 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 13 Feb 2015 Link to this post

    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!
     
  5. Congyuan
    Congyuan avatar
    32 posts
    Member since:
    Nov 2011

    Posted 13 Feb 2015 in reply to Danail Vasilev Link to this post

    Cool thanks you soooooooooooo much. it's realy helpful
    You are genius ;)
Back to Top
Kendo UI is VS 2017 Ready