Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Overview without Legend? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I've been browsing these forums for a while, and have got quite a few good bits of info from them. ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
|
Hi, If I understeand right then you wants 2 map, where the second map has the same centerpoint as the first, but with a different zoom level. So I would do it a little different, and first calculate the center of map 1, then pan the other map and leave the zoomlevel of the other map. Now wy it hangs. This is probably because you access MP2 from within an event of MP1. You confuse the engine What you can do is execute the code for MP2 "outsiide" the event. The most easy way to do that is to post a windows message to a custom message handler. This handler will execute as soon as vb.net enters the windows message pump, and that is Outside the event handler (a while later). Unfortionally Microsoft did not yet include PostMessage in the dotnet thing, but you can easy call the win32 API call by using P/Invoke. If you have a problem with that, then just yell here, and I post some code BTW: You could use a timer as whell (not a threading timer), but I should consider this as unprofessional programming style.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
|
You are spot on with understanding what I am trying to do. It makes sense that it would be confusing the engine. Do you know if there is a way to pan the map to a certain location without having to place a pushpin first? I've looked at the ActiveMap.Pan method, but that is for making custom pan buttons, not for panning to a certain location. I tried putting the exact same code in a button instead of the mp control's event, but it still hangs up when trying to add the pushpin to the mini map. I'm thinking it's not possible to use the same location variable on two different maps. It hangs up on miniTemp = mpMini.ActiveMap.AddPushpin(getLoc) and getLoc is set from a location on the larger mappoint control. Thanks for the response, I'm gonna keep trying different ideas until I come up with something that works. |
| |||
|
Hi, Quote:
Quote:
- then pan map2 to that position for the former you can use XYToLocation, and Gilles Kohl his code, for the latter just calll GotoLatLong.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
|
I got it working with the following code, but it's very slow to update when trying to pan around the map without zooming. It works great for zooming in and out, but once you try and pan around it has to update both maps simultaneously and it just lags. Code: Private Sub mp_AfterViewChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles mp.AfterViewChange
Dim temp As MapPoint.Pushpin, miniTemp As MapPoint.Pushpin, getLoc As MapPoint.Location
Dim mpX As Integer = CInt(mp.Width / 2), mpY As Integer = CInt(mp.Height / 2)
Dim tempLL As String
getLoc = mp.ActiveMap.XYToLocation(mpX, mpY)
temp = mp.ActiveMap.AddPushpin(getLoc)
tempLL = CalcPos(getLoc, 0, 0)
getLoc = mpMini.ActiveMap.GetLocation(globalLat, globalLong, 0)
miniTemp = mpMini.ActiveMap.AddPushpin(getLoc)
miniTemp.Location.GoTo()
mpMini.ActiveMap.Altitude = mp.ActiveMap.Altitude
mpMini.ActiveMap.ZoomOut()
temp.Delete()
miniTemp.Delete()
End Sub
|
| ||||
|
I realized I don't need to add the pushpins to the map since I already have the location of the center of the map using XYToLocation. It speeds up quite a bit not having to add the pushpins. I think I've got it all figured out now, just wanted to post this incase anyone else ever decides to try something like this. Code: Private Sub mp_AfterViewChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles mp.AfterViewChange
Dim getLoc As MapPoint.Location
Dim mpX As Integer = CInt(mp.Width / 2), mpY As Integer = CInt(mp.Height / 2)
getLoc = mp.ActiveMap.XYToLocation(mpX, mpY)
CalcPos(getLoc, 0, 0)
getLoc = mpMini.ActiveMap.GetLocation(globalLat, globalLong, 0)
getLoc.GoTo()
mpMini.ActiveMap.Altitude = mp.ActiveMap.Altitude
mpMini.ActiveMap.ZoomOut()
End Sub
|
| |||
|
Hi, thanks for feedback ! glad it works for you..
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| legend, overview |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| More than 8 in the legend? | papaj | MapPoint 2006/2009 Discussion | 1 | 10-25-2005 02:29 PM |
| Microsoft Dynamics GP Offshore Remote Support – Overview | Andrew Karasev | News and Announcements | 0 | 10-18-2005 07:15 PM |
| hide Legend and overview Pane | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-11-2004 09:10 AM |
| overview map scale | Anonymous | MapPoint 2006/2009 Discussion | 1 | 02-19-2004 10:42 AM |
| Legend | Larry | MapPoint 2006/2009 Discussion | 3 | 12-10-2002 12:45 PM |
Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.