在google map API 3 下 使用getBoundsZoomLevel 会找不到方法,这个方法是version 2里的,在新版本里,可以用
map.fitBounds(bounds);来代替使用。尤其是使用geocoder.geocode() 方法时,返回的results[0].geometry.viewport 就是我们要的bounds.
代码示例:
map.geocoder.geocode({
‘address': address
}, function(results, status){
if (status == google.maps.GeocoderStatus.OK) {
map.gmap.fitBounds( results[0].geometry.viewport);
}
else {
alert(“Geocode was not successful for the following reason: ” + status);
}
});
‘address': address
}, function(results, status){
if (status == google.maps.GeocoderStatus.OK) {
map.gmap.fitBounds( results[0].geometry.viewport);
}
else {
alert(“Geocode was not successful for the following reason: ” + status);
}
});
Thank you for your suggestion! I will try to modify it.
Been following your blog for 3 days now and i should say i am starting to like your post. and now how do i subscribe to your blog?
Oh,Thank you! I am glad to see you like my post. I just add a plugin for subscribing by email or by other social webcomponents .
Thank you again for your reminding.
Very good article. I’ve found your site via Google and I’m really happy about the information you provide in your articles. Btw your sites layout is really broken on the Kmelon browser. Would be cool if you could fix that. Anyhow keep up the good work!
Well,Thank you very much first! I dont always use Kmelon browser,and I just download a new version,and found that my blog’s right sidebar ‘Latest Comments’ display “getBoundsZoomLevel-google-map-api-v3″ as a long word,then the Kmelon doesnt change next line automaticly. So I change the post’s title to be
“getBoundsZoomLevel google map api v3″ which has 5 words then Kmelon start to know how to display properly.
:), Thank you again for your reminding!
I thought you would want to know that this website isn’t showing up right on my iphone. Cool site though!
Thank you for your suggestiong,but I’m so sorry that I dont have a iphone therefore I cant know how it display in your iphone. would you mind to tell me what the resolution of your iphone?
I can’t get your RSS feed to work right in google chrome, is it on my end?
It’s a pity that I also cant access “http://feedburner.google.com” by google chrome browser. I think it maybe a bug of the chrome browser. You can try other browser IE,firefox,Opera ,they are both okay.
I’m so sorry for that ! and I’ll give a notice when subscribe rss feed.
Thank you for your feedback!
I like this information shown and it has given me some sort of desire to have success for some reason, so thank you.