google.maps.MVCArray<T>
class
This class extends
MVCObject.
| Constructor | |
|---|---|
MVCArray |
MVCArray([array])Parameters:
A mutable MVC Array. |
| Methods | |
|---|---|
clear |
clear()Parameters: None
Return Value: None
Removes all elements from the array. |
forEach |
forEach(callback)Parameters:
Return Value: None
Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index). |
getArray |
getArray()Parameters: None
Return Value:
Array<T>Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object. |
getAt |
getAt(i)Parameters:
Return Value:
TReturns the element at the specified index. |
getLength |
getLength()Parameters: None
Return Value:
numberReturns the number of elements in this array. |
insertAt |
insertAt(i, elem)Parameters:
Return Value: None
Inserts an element at the specified index. |
pop |
pop()Parameters: None
Return Value:
TRemoves the last element of the array and returns that element. |
push |
push(elem)Parameters:
Return Value:
numberAdds one element to the end of the array and returns the new length of the array. |
removeAt |
removeAt(i)Parameters:
Return Value:
TRemoves an element from the specified index. |
setAt |
setAt(i, elem)Parameters:
Return Value: None
Sets an element at the specified index. |
| Events | |
|---|---|
insert_at |
function(index)Arguments:
This event is fired when insertAt() is called. The event passes the index that was passed to insertAt(). |
remove_at |
function(index, removed)Arguments:
This event is fired when removeAt() is called. The event passes the index that was passed to removeAt() and the element that was removed from the array. |
set_at |
function(index, previous)Arguments:
This event is fired when setAt() is called. The event passes the index that was passed to setAt() and the element that was previously in the array at that index. |