One of the tricky things that you need to work around when programming Virtual Earth is the VEMap.GetCenter() method doesn’t work when displaying the Birdseye or Oblique Map Style. I’m not exactly sure what the reasoning for this is, but this is one thing that I would like to see fixed in a future version. Luckily, there is an unsupported method of doing this.
The code shown below gets the center Lat/Long coordinate for the BirdseyeScene being shown, not the actual center of the Map. This isn’t exaclty what we’re looking for, but at least it gives us a better idea of the current position of the map than nothing.
Here’s a full example page that demonstrates getting the Map’s center Lat/Long “relatively” when in Birdseye or Oblique Map Style:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- 01 Jul 2020
- 06 Apr 2020
- 11 Mar 2020
- 15 Feb 2020
- 02 Jan 2020
Recent on Build5Nines.com
This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participates in affiliate programs with Udemy, and other sites. This site is compensated for referring traffic and business to these companies.