Anonymous
03-14-2005, 01:24 PM
In my event handler for AfterViewChange, I access the Location property of the Map and a few other properties of the Map, none of which cause an AfterViewChange event. WHen I click on the edge of the map to scroll it, it goes crazy, not stopping the scrolling for a while.
Any ideas on what the problem is? Ulitmately my goal is to get the latitude and longitude of the map.
Wilfried
03-14-2005, 01:48 PM
Hi,
probably the edge clicking will fire an AfterViewchange...
Wilfried
03-14-2005, 01:49 PM
Hi,
Ulitmately my goal is to get the latitude and longitude of the map.
what do you exacly mean by that ? A lat / long pair is just a point!
Anonymous
03-14-2005, 01:52 PM
The goal is that when the user changes the view, I need to update another piece of software with the user's map's current location. So the other piece of software will be "following" the user's map.
Wilfried
03-14-2005, 02:01 PM
Hi,
Dont understeand, please enlighten more....
Anonymous
03-14-2005, 02:09 PM
Let's say you have two maps running. The user pans to a new location on one of the maps. I want to tell the other map to pan to that same location. Theoretically, this can be done using the AfterViewChange event by getting the first map's Location object, and then calculating the latitude and longitude of that Location object. Next, I would tell the second map to set its Location to the same latitude/longitude of the first map's Location property.
Wilfried
03-15-2005, 01:49 AM
Hi,
Now I understeand. For the first map just find the center of the map by Width / 2 and Height / 2 to get x, y.
For the second map use XYToLocation(x, y).GoTo(); to pan to the specific point. Eventually you can also save / use Altitude to get them both at same zoom level.
The problem you had in your event handler is probably due to lengty code. Try make it as efficient as possible in speed, or execute it "outside" the event handler, eg by posting a message to a custom message handler.