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 |
![]() |
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 03:53 AM |
| How to add click event for VB.Net ? | Anonymous | MapPoint 2006/2009 Discussion | 2 | 12-31-2003 12:15 AM |
| Double Click on map | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-08-2003 06:42 PM |
| Mouse Click on legend | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-10-2003 05:39 PM |
| What happens when YOU click on a street? | schuchhardp | MapPoint 2006/2009 Discussion | 5 | 01-03-2003 10:37 AM |
Cheap flights to Athens
Book cheap flights to Athens on Holiday Hypermarket and you can book some great value accommodation too! Check it out online.
Travel Agency
We are a Queen's Award winning travel agency here to help with your travel plans.
Cuba Holidays
After years of neglect by the western world, Cuba is coming back onto the holiday scene. Cuba Holidays are a unique and enjoyable experience. Book at dealchecker.co.uk.
Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!
Cheap Egypt Holidays
Pick up a bargain cheap Egypt holiday online when you visit ulookubook.com. Just check out our tips to make sure you book at the right time to get a great holiday for a great price. Finding cheap Egypt holidays can be simple when you know how.
Family package holidays
Save a lot of time and opt for one of the great family package holidays at Travel.co.uk
Cheap holidays to Portugal
Enjoy a spectacular country at a fraction of the cost. Find information on cheap holidays to Portugal at On The Beach.