ASP.NET Pack Programmer's Guide
ObservableCollection.removeRange Method
See Also
 





Deletes a range of items from the collection.

Namespace: MindFusion.Mapping
Package: ObservableCollection.js

 Syntax

JavaScript  Copy Code

function removeRange (index, count)

 Parameters

index

Number. The starting index of the range to remove.

count

Number. The length of the range to remove.

 Example

The following code checks if the count of items in a decorations list is more than 10 and if yes - removes all items after the 5th one. The decorations property is of type ObservableCollection.

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";
markers.decorations.add(mark);
............................
mark = new m.Marker();
mark.location = new m.LatLong(41.89021, 12.492231);
mark.imageSrc = "./images/colosseum100.png";
mark.text = "Colloseum";

.....................
if(markers.decorations.count > 10)
    markers.decorations.removeAt(5, markers.decorations.count - 5);

 See Also

ObservableCollection Members
ObservableCollection Class
MindFusion.Mapping Namespace