How to reset a map

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

    Posted 06 Jan 2016 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
    Iliana Nikolova avatar
    2622 posts

    Posted 08 Jan 2016 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
    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.

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top