Is there a way to click Marker?

Hello,
Is there a way to click Marker then view its coördinates?
Anyone know how to do this?..thanks in advance

1 Like

This example shows how to identify a shape within a layer, and get it’s properties. You can also get it’s Shape, and extract the x, y coordinate.

Note that the above example is based on hovering, using the Identify feature. There is also a way to Select features using the mouse click, but we don’t have a published example of that. If it helps, I may be able to come up with an example.

Hope this can get you started.

Regards,
Jerry.

1 Like

@jerryfaust thank you for the info. and for the link I’ll try it out see if I can get it working,

i tried the example
CodeView
but when i run the program, i got an error
ErrorView

Hello @SandMan88

Sorry for the delayed response. I built a simple app almost identical to your example, and I’m able to run. So I’m guessing that there’s perhaps some fundamental issue, perhaps with the map control settings or something. Would you mind zipping up your entire sample project so that I can try it here? You don’t have to send your data, I can use one of my shapefiles.

Regards,
Jerry.

Hello @jerryfaust
Here is My Sample Project,Thank you for time,
i installed MapWinGIS-only-v5.0.0.0-x64 and i’m using visual studio 2012
MapWinGIS.zip (560.3 KB)

hello @jerryfaust i got running, it shows no error i use MapWinGIS-only-v5.0.1.0-Win32…sorry that was my bad… gonna try it in my marker…thank you soo much for your time

hello @jerryfaust, i got it running, i have three marker when i hover to the first one it works but for the other two all i got is x=0 and y=0 please help
this is my Code
getXY
I’ve been wondering if its possible to add attribute to marker ???
…thank n advance

I think the problem is in the following line:

sf.get_Shape(e.shapeIndex).get_XY(0, ref x, ref y);

You correctly use e.shapeIndex to get the shape, but the point within the shape will always be at index 0.

Jerry.

Thank you @jerryfaust ,I really appreciate your attention. I got it running,
i was wondering can i add attribute to my marker, if yes can you give an exzample or link ,
i just want to add date
LoadMarker
…thanks in advance

You would use the EditAddField call. And you need to wrap it in the sf.StartEditingTable and sf.StopEditingTable calls.

@jerryfaust… thank you

hello @jerryfaust ,I really appreciate your time and attention, i got it running…a million thanks

This topic was automatically closed after 5 days. New replies are no longer allowed.