How to reset a map

2 posts, 0 answers
  1. Jim
    Jim avatar
    4 posts
    Member since:
    Dec 2015

    Posted 06 Jan Link to this post

    What is the correct way to reset a map?

    We have a button that a user clicks to load a map and display shapes on that map.

    However if the user clicks the button again the original shapes remain on the map plus the new shapes are added to the map.

    I've tried to destroy the map as well as clearing out the datasource but when I try either approach I can't get the shapes to render.

     

    Please advise.

     

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 08 Jan Link to this post

    Hi Jim,

    If I understand correctly you would like to remove the map markers? If this is the case you could use the following code snippet: 
    //get reference to the map
    var map =$("#map").data("kendoMap");
    //clear all markers
    map.markers.clear();
    In case I am missing something, please provide more details about the exact scebario you are trying to implement - this way I would be able to advice you further.

    Regards,
    Iliana Nikolova
    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
Back to Top