Forum Home

Simple Event

Here you can make any kind of event in the map.As for example,in this sample page,when you click the map, an event triggers and a message is shown.



Map Click event

var agmap = null; //declare a global map object

function initAGMap()
{
	agmap = new AGMap(document.getElementById("MapPanel"));
	agmap.centreAndScale(new AGCoord(-25.7482681, 28.2259351), 12);
	AGEvent.addListener(agmap,"onclick", mapClickHandler);
}

function mapClickHandler(oPointClicked)
{
   alert("You clicked the map");
}