sahbiouali / webglearth

Automatically exported from code.google.com/p/webglearth
0 stars 1 forks source link

Change Zoom Level after finding a location #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Look for a location

What is the expected output? What do you see instead?
I expected the camera to zoom in after finding a location, but instead the 
camera stays at the curent zoom level. You can zoom in manually of course. But 
I expected it to automatically adjust zoom level, especially if you zoomed out 
a lot.

What version of the product are you using? On what operating system?
Google Chromium 10.0.632.0 (70722) on Mac OS 10.6.5

Please provide any additional information below.

Original issue reported on code.google.com by laurent....@gmail.com on 20 Jan 2011 at 1:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The geocoding search bar in WebGL Earth is using the open-source Nominatim 
service (OpenStreetMap data), in fact the free and unlimited online service 
from MapQuest is called whenever you search: 
http://open.mapquestapi.com/nominatim/.

Part of the JSON response is also the boundingbox (min/max for lat/lon).

So the task is to find for the given bounding box and the actual viewport 
(window size) the relevant zoom level in mercator pyramid. It should be quite 
easy with math from 
http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/.

BTW This function should be also exported into the JavaScript API as 
.setBounds().

Original comment by klo...@gmail.com on 20 Jan 2011 at 11:27

GoogleCodeExporter commented 8 years ago

Original comment by slouppetr on 24 Oct 2011 at 9:51