MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Trying to get the MapPoint.Location at a mouse event

This is a discussion on Trying to get the MapPoint.Location at a mouse event within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I need to present a MapPoint map to the user and allow him to click (or double-click) the location ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2005
Senior Member
Green Belt
 
Join Date: Jul 2005
Posts: 105
Trying to get the MapPoint.Location at a mouse event

Hi,

I need to present a MapPoint map to the user and allow him to click (or double-click) the location of interest. Then I'd like to get the MapPoint.Location which corresponds to his click.

I don't think the mouse-down or mouse-up events will work, since I want the user to be able to use the default mouse features of MapPoint to select his active map area. So I think that means I need to use double-click, and that causes a problem since MapPoint will display a dialog with nearby addresses, upon a double click.

I woud like to find out how to retrieve the address selected by the user, but I don't know how. So I have been left with overriding BeforeDblClick, but this code only gets called if the user double-clicks on a part of the map where there are not too many streets. If he double-clicks where there are other roads, the dialog willcome up and my code won't get called.

Any ideas?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-20-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Use the BeforeClick and check the Shift or Control. So user have control or if he click with Shift or Ctrl he has your code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-20-2005
Senior Member
Green Belt
 
Join Date: Jul 2005
Posts: 105
Ctrl or Shift is a great idea!

Hi,

That's a great way to differentiate a double-click. But how do I check if either of these keys was down?


Thanks,
Bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 07-20-2005
Senior Member
Green Belt
 
Join Date: Jul 2005
Posts: 105
I tried using the keyboard too, but without success

Hi,

I actually quickly tried the Ctrl and Alt keys, but they didn't help. When I override the BeforeDblClick event, the MapPoint dialog of addresses sometimes gets the event, leaving my code untouched. It turns out that when I double-click in a area with lots of street and intersections, the MapPoint dialog comes up displaying alternatives. But if I click away from other streets, I get the event in my BeforeDblClick event handler.

Would anybody know how to get the address selected by the user? Any selection in the dialog will obviously be close, and I only need the lat/long actually. But this dialog (of MapPoint's) is stealing the event so my event handler never gets the lat/long of the mouse double-click.

Thanks,
Bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 07-21-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

I just checked, and you only can see if the shift was pressed down. So you can determine the dfference. If shift was pressed down you set Cancel to True and this will cancel the action that mappoint will normally do, so you can safe execute your code.

You dont have the lat/long in the clickevent but you have the x/y coordinates of the screen, so you can use them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 07-25-2005
Junior Member
White Belt
 
Join Date: Aug 2003
Posts: 10
Event

Can't the SelectionChange event be used?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 07-30-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Quote:
Can't the SelectionChange event be used?
Possible yes, but he wants to cancel the mappoint popup menu if I have understeand it well, and that only can be done in the beforeClick events.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
event, mappointlocation, mouse


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Capturing Mouse Wheel Event Anonymous MapPoint Web Service and Virtual Earth 2 11-30-2005 08:31 AM
find city name & state name on mouse move event Atul22 MapPoint 2006/2009 Discussion 2 10-15-2004 05:28 AM
is there a way of geting the location of the mouse pointer matt1168 MapPoint 2006/2009 Discussion 3 07-04-2003 02:25 PM
mouse down event henemonster MapPoint 2006/2009 Discussion 1 03-31-2003 03:04 PM
Mouse Down Event -> Form_DB.Show-> Problems with Varia blackmap MapPoint 2006/2009 Discussion 3 01-29-2003 08:17 AM


All times are GMT -5. The time now is 01:38 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54