ASP.NET Pack Programmer's Guide
IEnumerable.clear Method
See Also
 





Clears the collection.

Namespace: MindFusion.Mapping
Package: IEnumerable.js

 Syntax

JavaScript  Copy Code

function clear ()

 Example

The following code creates new Marker-s and add them to the decorations collection of a DecorationLayer called markers. It checks if the decoration items are more than 20 and if yes - clears the collection. The decorations property is of type ObservableCollection, which derives from IEnumerable.

JavaScript  Copy Code

var m = MindFusion.Mapping;

var markers = new m.DecorationLayer("Images");

// create some markers with images
var mark = new m.Marker(new m.LatLong(-22.951916, -43.210487));
mark.imageSrc = "./images/christ_redeemer.png";
mark.text = "Christ the Redeemer";

mark = new m.Marker();
mark.location = new m.LatLong(41.89021, 12.492231);
mark.imageSrc = "./images/colosseum100.png";
mark.text = "Colloseum";
markers.decorations.add(mark);
...........................
if(markers.decorations.count > 20)
 markers.decorations.clear();

 See Also

IEnumerable Members
IEnumerable Class
MindFusion.Mapping Namespace