April 2010
M T W T F S S
« Mar   May »
 1234
567891011
12131415161718
19202122232425
2627282930  

Change mouse type in Google map api

// GMap2

function changeMouse()
{
map.getDragObject().setDraggableCursor(”crosshair”);

}

function resetMouse()
{
map.getDragObject().setDraggableCursor(””);
}

ref: http://econym.org.uk/gmap/cursors.htm

// old version

function changeMouse()
{
map.setOptions({ draggableCursor: ‘crosshair’ });
}

function resetMouse()
{
map.setOptions({ draggableCursor: ” });
}

ref: http://stackoverflow.com/questions/2557679/how-do-i-change-the-mouse-cursor-when-i-mouseover-on-a-particular-area-in-google

Remove array from index (javascript)

for (var i = overlayPlacemarkTemp.length-1;  i >= 0; i–)
{
if (overlayPlacemarkTemp[i].getIcon().image.indexOf(pt) != -1)
{
// map === remove overlay
myGMap.removeOverlay(overlayPlacemarkTemp[i]);
// remove []
overlayPlacemark.remove(i);
//overlayPlacemarkTemp.length = overlayPlacemarkTemp.length – 1;
}
}

Add, remove elements from javascript array

var arr = [1,2,3];

arr.push(4); //Adds new elements to the end of an array, and returns the new length, result arr = [1,2,3,4];
arr.pop(); //Removes the last element of an array, and returns that element, result arr = [1,2];
arr.length = 0; // remove all element