Make a Pin activate onclick

This Page is locked
Modified: 2007/01/13 02:36 by ViaVE Visitor
By default when you click on a push pin it actually cancels the popup.
Use this instead:


function AddClickablePin(location, icon_url, title, details, iconStyle)
{
	var pin = new VEPushpin(pinID, location, icon_url, title, details, iconStyle);
	map.AddPushpin(pin);
	var element = document.getElementById(pinID);
	element.onclick = EventHandlerOnClick;
	pinID++;
}

function EventHandlerOnClick(e) { if (e!=null) { document.getElementById(e.currentTarget.id + "_" + map.GUID).onmouseover(); } else { document.getElementById(window.event.srcElement.id).onmouseover(); } }