<p>I'm trying to find the latitude and longitude of the corners of my map while in birdseye view.  I want to be able to plot pins on the map, but I have hundreds of thousands of addresses that I want to be able to limit to the ones that need to show on the map.</p>

<p>In normal view, VEMap.GetMapView().TopLeftLatLong and .BottomRightLatLong return the coordinates I need; but in Birdseye view they return blank (or encrypted values).  The SDK recommends using VEBirdseyeScene.GetBoundingRectangle(), but this returns bounds of up to two miles from the center of my scene which in major cities still returns way too many addresses.</p>

<p>In previous versions of the VE Control, there was an undocumented VEDecoder object I could use to decrypt the LatLong values for the birdseye scenes, but this object seems to have disappeared (probably been renamed).  How can I decode these values in version 6.1?</p>

[{'answer_id': 33238, 'author': 'MartinHN', 'author_id': 2972, 'author_profile': 'https://Stackoverflow.com/users/2972', 'pm_score': 0, 'selected': False, 'text': '<p>According to <a href="http://dev.live.com/virtualearth/sdk/" rel="nofollow noreferrer">http://dev.live.com/virtualearth/sdk/</a> this should do the trick:</p>\n\n<pre><code>function GetInfo()         \n{\n  alert(\'The latitude,longitude at the center of the map is: \'+map.GetCenter());         \n}\n</code></pre>\n'}, {'answer_id': 39986, 'author': 'Soldarnal', 'author_id': 3420, 'author_profile': 'https://Stackoverflow.com/users/3420', 'pm_score': 2, 'selected': False, 'text': "<p>From the VEMap.GetCenter Method documentation:</p>\n\n<blockquote>\n  <p>This method returns null when the map\n  style is set to VEMapStyle.Birdseye or\n  VEMapStyle.BirdseyeHybrid.</p>\n</blockquote>\n\n<p>Here is what I've found, though:</p>\n\n<pre><code>var northWestLL = (new _xy1).Decode(map.GetMapView().TopLeftLatLong);\nvar southEastLL = (new _xy1).Decode(map.GetMapView().BottomRightLatLong);\n</code></pre>\n\n<p>The (new _xy1) seems to work the same as the old undocumented VEDecoder object.</p>\n"}, {'answer_id': 67303, 'author': 'Chris Pietschmann', 'author_id': 7831, 'author_profile': 'https://Stackoverflow.com/users/7831', 'pm_score': 3, 'selected': True, 'text': '<p>Here\'s the code for getting the Center Lat/Long point of the map. This method works in both Road/Aerial and Birdseye/Oblique map styles.</p>\n\n<pre><code>function GetCenterLatLong()\n        {\n            //Check if in Birdseye or Oblique Map Style\n            if (map.GetMapStyle() == VEMapStyle.Birdseye || map.GetMapStyle() == VEMapStyle.BirdseyeHybrid)\n            {\n                //IN Birdseye or Oblique Map Style\n\n\n                //Get the BirdseyeScene being displayed\n                var birdseyeScene = map.GetBirdseyeScene();\n\n\n                //Get approximate center coordinate of the map\n                var x = birdseyeScene.GetWidth() / 2;\n                var y = birdseyeScene.GetHeight() / 2;\n\n                // Get the Lat/Long \n                var center = birdseyeScene.PixelToLatLong(new VEPixel(x,y), map.GetZoomLevel());\n\n                // Convert the BirdseyeScene LatLong to a normal LatLong we can use\n                return (new _xy1).Decode(center);\n            }\n            else\n            {\n                // NOT in Birdseye or Oblique Map Style\n                return map.GetCenter();\n            }\n        } \n</code></pre>\n\n<p>This code was copied from here:\n<a href="http://pietschsoft.com/post/2008/06/Virtual-Earth-Get-Center-LatLong-When-In-Birdseye-or-Oblique-Map-Style.aspx" rel="nofollow noreferrer">http://pietschsoft.com/post/2008/06/Virtual-Earth-Get-Center-LatLong-When-In-Birdseye-or-Oblique-Map-Style.aspx</a></p>\n'}, {'answer_id': 860198, 'author': 'Jason', 'author_id': 7391, 'author_profile': 'https://Stackoverflow.com/users/7391', 'pm_score': 2, 'selected': False, 'text': '<p>It always seems to me that the example solutions for this issue only find the centre of the current map on the screen, as if that is always the place you\'re going to click! Anyway, I wrote this little function to get the actual pixel location that you clicked on the screen and return a VELatLong for that. So far it seems pretty accurate (even though I see this as one big, horrible hack - but it\'s not like we have a choice at the moment).</p>\n\n<p>It takes a VEPixel as input, which is the x and y coordinates of where you clicked on the map. You can get that easily enough on the mouse event passed to the onclick handler for the map.</p>\n\n<pre><code>function getBirdseyeViewLatLong(vePixel)\n{\n    var be = map.GetBirdseyeScene();\n\n    var centrePixel = be.LatLongToPixel(map.GetCenter(), map.GetZoomLevel());\n\n    var currentPixelWidth = be.GetWidth();\n    var currentPixelHeight = be.GetHeight();\n\n    var mapDiv = document.getElementById("map");\n    var mapDivPixelWidth = mapDiv.offsetWidth;\n    var mapDivPixelHeight = mapDiv.offsetHeight;\n\n    var xScreenPixel = centrePixel.x - (mapDivPixelWidth / 2) + vePixel.x;\n    var yScreenPixel = centrePixel.y - (mapDivPixelHeight / 2) + vePixel.y;\n\n    var position = be.PixelToLatLong(new VEPixel(xScreenPixel, yScreenPixel), map.GetZoomLevel())\n    return (new _xy1).Decode(position);\n}\n</code></pre>\n'}, {'answer_id': 1089877, 'author': 'itchi', 'author_id': 86017, 'author_profile': 'https://Stackoverflow.com/users/86017', 'pm_score': 0, 'selected': False, 'text': '<p>An interesting point in the Bing Maps Terms of Use..\n<a href="http://www.microsoft.com/maps/product/terms.html" rel="nofollow noreferrer">http://www.microsoft.com/maps/product/terms.html</a></p>\n\n<p><em>Restriction on use of Bird’s eye aerial imagery:\nYou may not reveal latitude, longitude, altitude or other metadata;</em> </p>\n'}]
['https://Stackoverflow.com/questions/32621', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3420/']