Adds an item to the collection at the specified index.
Namespace: MindFusion.Mapping
Package: ObservableCollection.js
JavaScript Copy Code |
---|
function insert (index, item) |
Number. The index.
Object. The object to add.
The following code checks if the count of items in a decorations list is more than 4 and if yes - inserts a new item at the 4th place in the collection. 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 |