Community of VE/MapPoint Users and Developers
This is a discussion on Getting Lat and long area from user's selection within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am using the mappoint ActiveX control in a VB app. I want to get a range of lat and ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Getting Lat and long area from user's selection I can get the objMap.SelectedArea and I can check for pushpins, select pushpins etc but I can't get the lat and long of the selected area. I can get the top, left, width, height of the selected area in relation to the active map but that is a far cry from getting the lat/long. Does anyone know of a calculation I can use? Thanks |
| |||
|
Here's what I use to do that Code: Dim sa As MapPoint.SelectedArea
Dim dbllat As Double
Dim dbllon As Double
sa = objmap.SelectedArea
objloc = objmap.XYToLocation(sa.Left, sa.Top)
CalcPos(objmap, objloc, 1)
objloc = objmap.XYToLocation(sa.Left + sa.Width, sa.Top + sa.Height)
CalcPos(objmap, objloc, 2)
http://www.mp2kmag.com/articles.asp?...xtract.lat.lon M |
| ||||
|
Well, I already have an ActiveX control on my form, so declaring a new mappoint control dosen't really help. I have tried to declare a mappoint.mappoint control and assign it to my ActiveX control, but i get an "Invalid cast" error. So apperently I can't use that interface with the ActiveX control. So I'm wondering how to get the selected area then? Am I overlooking something?
__________________ Best Regards. Bug Microsoft Certified Solutions Developer |
| |||
|
OK, now I'm back doing some coding work I'll show you exactly instead of from my note book Code: Dim objmap As MapPoint.Map Code: Me.AxMappointControl1.NewMap("C:\mymapname.ptm")
objmap = AxMappointControl1.ActiveMap
Once you've declared objmap as a mappoint object and assigned it to the active map of your control, selectedarea will be a control you can selet from it M |
![]() |
| Tags |
| area, lat, long, selection, user |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| [Multi pushpins selection ?] | Vincent BENNER | MapPoint 2006/2009 Discussion | 4 | 01-30-2003 05:41 AM |
| Identifying Selection with Mouse | MapPointJim | MapPoint 2006/2009 Discussion | 3 | 08-20-2002 05:39 PM |