[mapguide-users] Handle the Double-Click event on the Map

Scott McFarlane scott at geotropix.com
Wed Mar 14 14:14:14 EDT 2007


Hi Karam,

Are you using the AJAX viewer? When using the AJAX viewer, just about
anything is possible. The following JavaScript code, when placed in the task
pane page for example, will initialize an event handler for the double-click
event on the map.

var main = parent.parent;
var map = main.GetMapFrame();

map.ondblclick = function(e)
{
	// Only respond in selection mode.
	if(map.tool != 0)
		return;

	var x = e.clientX - map.mapPosX;
	var y = e.clientY;
	var pt = map.ScreenToMapUnits(x, y);

	alert(pt.X + ',' + pt.Y);
}

This example simply displays an alert box with the double-clicked location
in map units. Hopefully this will get you started.

- Scott


-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of m.karam
Sent: Wednesday, March 14, 2007 11:47 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Handle the Double-Click event on the Map


How can I handle double-click event on the map?

Regards

Karam
-- 
View this message in context:
http://www.nabble.com/Handle-the-Double-Click-event-on-the-Map-tf3402946s166
10.html#a9477169
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users






More information about the mapguide-users mailing list