I'm having some trouble with the Google Maps API; I want to determine a LatLong for a certain place (for example, from the name of a city), then focus my map on it. The LatLong part is working, and so is centering the map on that point. However, I cannot figure out how to determine what a good zoomlevel might be when I only have that single point. I cannot just go to some standard zoomlevel that might look good most of the time, 'cause what happens when the user enters "Russia" instead of "Amsterdam", for example? Some help would be appreciated 🙂
Google-maps – Determining zoom level from single LatLong in Google Maps API
google-maps
Related Question
- Jquery – How to disable mouse scroll wheel scaling with Google Maps API
- Google-maps – What parameters should I use in a Google Maps URL to go to a lat-lon
- Javascript – Google Maps JS API v3 – Simple Multiple Marker Example
- Android – Google Maps v2 – set both the location and zoom in
- Javascript – Google Maps & JavaFX: Display marker on the map after clicking JavaFX button
Best Solution
I just asked this question at Google IO. This feature exists, but is undocumented and doesn't have accessors for it yet. What you want to do is get the Structured Address. Inspect the json structure you get back and look for these new parameters. I'll post more information when I get a chance to try this out.