Checks if the given element is present in the collection.
Namespace: MindFusion.Mapping
Package: IEnumerable.js
JavaScript Copy Code |
---|
function contains (item) |
Object. The object to check for.
Boolean. True if the element is found, otherwise false.
The following code creates new Marker-s and add them to the decorations collection of a DecorationLayer called markers. Then it checks if an item is contained within the collection and if yes - removes it. 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 mark1 = new m.Marker();
if(markers.decorations.contains(mark)) |