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





Removes a range of elements starting from the given index.

Namespace: MindFusion.Mapping
Package: IEnumerable.js

 Syntax

JavaScript  Copy Code

function removeRange (index, count)

 Parameters

index

Number. The starting index of the range.

count

Number. The length of the range.

 Example

The following code checks if there are more than 10 items in a DecorationLayer decorations property. If yes, it removes the last 5 of them. 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";
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";
markers.decorations.add(mark);
...........................
...........................


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

 See Also

IEnumerable Members
IEnumerable Class
MindFusion.Mapping Namespace