Community of VE/MapPoint Users and Developers
This is a discussion on Long/Lat from click. within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am working on a tracking system and mappoint is my mapping software. I am using VB for my programming. ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Long/Lat from click.
__________________ ========= Milo |
| ||||
|
Yes, here is alink to the article that will help you. http://www.mp2kmag.com/articles.asp?ArticleID=13
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| |||
|
You know, I don't think that's the answer he's looking for, though I could be wrong. If I'm not, I'm looking for the same answer. The article points to a routine that is well known around here for extracting the lat/long from a pushpin. But what if you are just trying to react to a users click of a spot on the map, similar to what the location tool does.....as you move about on the map it reports the lat/long. The closest thing I can get to that involves the user having to place a pushpin at the desired location, then push a VB button.....which then executes the above.......as long as the user doesn't change the name of the pushpin. |
| ||||
|
Look at the MouseDown or MouseUp event Quote:
Now take a look at the XYToLocation method. Use it to take the x/y of the mouse and get a location object. At this point you should have the required stuff to use the calcpos function to return the lat/lon. Also, there is another article that uses the same concept in .net to demonstrate the location sensor (uses the mousemove event) http://www.mp2kmag.com/a66--location....mappoint.html
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| |||
|
yeah this is what i have come to but i dont know how yo use the function calcpos. could you give an exapmle of how to use it? I keep getting an error, object variable or with block variable not set. Regards,
__________________ ========= Milo |
| ||||
|
Ok, Let me know if this works for you. Visual Basic 6 Assumes you have the CalcPos Sub and the Function Arccos by Author Gilles Kohl in you project. http://www.mp2kmag.com/articles.asp?ArticleID=13 References: Microsoft MapPoint 11.0 Object Library(North America) MapPointControl.ocx is on Form1 One Command Button (Command1) Code: Public ilat As Double
Public ilon As Double
Private Sub Form_Load()
Dim objmap As MapPointctl.Map
Set objmap = MappointControl1.NewMap(geoMapNorthAmerica)
End Sub
Private Sub Command1_Click()
Dim objmap As MapPointctl.Map
Set objmap = MappointControl1.ActiveMap
Dim objLoc As MapPointctl.Location
Dim objPushpin As MapPointctl.Pushpin
Set objLoc = objmap.FindResults("Seattle, WA")(1)
Set objPushpin = objmap.AddPushpin(objLoc, "My Test Pushpin")
CalcPos objmap, objPushpin.Location, ilat, ilon
MsgBox ilat & ", " & ilon
End Sub
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| click, long or lat |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where did I click on that line? | Jumbly | MapPoint 2006/2009 Discussion | 3 | 12-08-2004 04:53 AM |
| How to add click event for VB.Net ? | Anonymous | MapPoint 2006/2009 Discussion | 2 | 12-31-2003 01:15 AM |
| Double Click on map | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-08-2003 07:42 PM |
| Mouse Click on legend | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-10-2003 06:39 PM |
| What happens when YOU click on a street? | schuchhardp | MapPoint 2006/2009 Discussion | 5 | 01-03-2003 11:37 AM |