mouse click on symbols to load information

Topics: General Topics
Oct 12, 2006 at 8:28 AM
Hi,
how is it possible realize a mouse click on symbols (for example symbol layer that represent bus stop on a map) in order to redirect to another web page?
There are methods or properties that help me to do this?

Thanx in advance
Coordinator
Oct 13, 2006 at 9:25 AM
Sure...

Just trap the mouse click, convert to World coordinates, find the feature there on the layer you're interested in (Bus Stops, for example) by using ExecuteIntersectionQuery, and then launch a browser window with that feature ID (or feature ID list).
Oct 16, 2006 at 4:32 PM
Thanx for your help codekaizen.
I'm developing a web application by using Ajaxmap.

In aspx:
<smap:AjaxMapControl width="50em" height="40em" id="ajaxMap" OnClickEvent="Mouse_Click()" runat="server" style="left: 23em; top: 4em;border:1px solid #000" />

In Code Behind:
protected void map_Click (object sender, EventArgs e)
{
Point ClickPnt = ajaxMap.Map.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
.......
}

How to retrieve mouse coordinate(x,y) on map?
Coordinator
Oct 16, 2006 at 9:52 PM
Hi,


protected void map_Click (object sender, EventArgs e)
{
---> This already converts your map coordinates into map coordinates
Point ClickPnt = ajaxMap.Map.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
.......
}

Now you just have to query your datasource with

FeatureDataSet fds = new FeatureDataSet();
myShapeLayer.DataSource.ExecuteIntersectionQuery(ClickPnt, fds);


BR
/Christian


Oct 19, 2006 at 9:41 AM
Thanx for your help,
i have tried as you suggest me:

Point ClickPnt = ajaxMap.Map.ImageToWorld( new Point( e.X, e.Y) );

but this line give me the following error:
"Impossible to cast implicitally SharpMap.Geometry.Point type into System.Drawing.Point".

It'is a problem related to ajaxMap? How to cast this value?

Thanx in advance
Oct 20, 2006 at 3:18 PM
Urgent:

Hi,
any news about ajaxMap project?

I'm using Mnorm_Ajax3.zip downloaded from iter.dk (August 2006 - now expired) and i'm interested to download the latest version in order to try to solve the implicit cast problem related to:

System.Drawing.Point ClickPnt = ajaxMap.Map.ImageToWorld( new Point( e.X, e.Y) );

Thanx in advance for your help and availability!