最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Animate zoom to google map location on click(custom google maps controls) - Stack Overflow

programmeradmin3浏览0评论

I want to have google map displaying whole planet(zoomed out maximally). Then, I would like to put overlay over map with button. When user click on button the overlay is removed and google map is automatically animating to the location i want.

So, I am not asking for plete solution, I just want you to tell me if it's possible to do that using google map js api, and if you can give me some direction, that would be awesome. I have searched a lot but found nothing on this subject.

Thanks.

I want to have google map displaying whole planet(zoomed out maximally). Then, I would like to put overlay over map with button. When user click on button the overlay is removed and google map is automatically animating to the location i want.

So, I am not asking for plete solution, I just want you to tell me if it's possible to do that using google map js api, and if you can give me some direction, that would be awesome. I have searched a lot but found nothing on this subject.

Thanks.

Share Improve this question edited Mar 2, 2016 at 21:36 MWiesner 9,07812 gold badges39 silver badges72 bronze badges asked Mar 2, 2016 at 21:26 Nikola MiticNikola Mitic 1,4923 gold badges13 silver badges27 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

I've noticed, that if difference between current zoom level and new zoom level more that 2, google maps won't make smooth zooming.

You can take a look at same question: How to zoom in smoothly on a marker in Google Maps?

map.setCenter(new google.maps.LatLng(theLatitude, theLongitude));
map.setZoom(yourZoomLevel);

See also: change location to preset coordinates and zoom with click of a button

发布评论

评论列表(0)

  1. 暂无评论