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

How to reset a map

1 Answer 198 Views
Map
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 06 Jan 2016, 05:39 PM

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.

 

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 08 Jan 2016, 03:06 PM
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!
 
Tags
Map
Asked by
Jim
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or