Community of VE/MapPoint Users and Developers
This is a discussion on Identifying Selection with Mouse within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; working in VB with a Mappoint object. I'm trying to select a starting point on a map (a lat/long position) ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Identifying Selection with Mouse I'm trying to select a starting point on a map (a lat/long position) using my mouse pointer. It looks like I can either click a location on a map (like a city) or draw a rectangle. Either way I need to identify the lat/long of either the selected city or upper left corner of my drawn retangle. I have some code I downloaded off this site to identify the lat log if given zipcode for the input. My question is this: Can I return a zipcode from either of the above two selection methods? Or is there a better way to do this. |
| ||||
|
This code sample will: If you click your mouse on the map, if it is a location type it will give you a message box with the Lat/Lon. Here is an article you need to check out: A More Compact Method for Obtaining Lat/Long. Author: Gilles Kohl http://www.mp2kmag.com/articles.asp?ArticleID=13 'Put Gilles code in a bas module for the CalcPos function call. 'Put this in the general declatations section Public thelat As Double Public thelon As Double 'I'm using a Mappoint ActiveX Control named MappointControl1 on my form for this example Private Sub MappointControl1_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object) On Error GoTo error: Dim objmap As MapPointCtl.Map Dim objLoc As MapPointCtl.Location Set objmap = MappointControl1.ActiveMap If TypeOf objmap.Selection Is Location Then Set objLoc = objmap.Selection CalcPos objmap, objLoc, thelat, thelon MsgBox thelat & " , " & thelon End If Exit Sub error: End Sub
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| ||||
|
I think if you do something with the lat/lon other than bring it up in a message box you will not get that error. The message box is waiting for you to click "OK" keeping that SelectionChange event open gives that error.
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| identifying, mouse, selection |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is this possible? Identifying points within radius of terr. | Kogenta | MapPoint 2006/2009 Discussion | 1 | 01-17-2006 01:56 PM |
| Pushpin Selection | EdB | MapPoint 2006/2009 Discussion | 2 | 08-14-2005 10:25 AM |
| Getting dataset from user selection | mic6399 | MapPoint 2006/2009 Discussion | 1 | 09-23-2004 11:59 AM |
| Zoom to selection? | sthurlock | MapPoint 2006/2009 Discussion | 6 | 12-10-2003 07:53 PM |
| Have successfully exported a map selection from Ma.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-05-2001 05:14 AM |