Google地图可以设置为一个慢速常量锅吗?像全球革命一样? [英] Can Google Maps be set to a slow constant pan? Like a globe revolution?

查看:114
本文介绍了Google地图可以设置为一个慢速常量锅吗?像全球革命一样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题所说的。我正在寻找一个解决方案,但是我还没有找到任何能够引导我去正确的文档或文章的东西。



如果您有任何想法或可以指出我可能解决方案我可以使用,它将不胜感激。



谢谢

解决方案

你可以这样做:



这应该会给你一个简单的动画这就是你想要的。您希望调整您给 setInterval 的时间间隔以获得当然感觉平滑的时间间隔。你应该有这样的东西:

  //创建您的地图并将其保留在地图变量中。 
setInterval(function(){
map.panBy(x,0);
},n);

选择恰当的 x n 值取决于您。


Just what the title says. I am searching for a solution but I have not found anything that has guided me to the correct documentation or articles.

If you have any ideas or can point me to a possible solution I can work with, it would be greatly appreciated.

Thanks

解决方案

You can do this yourself like this:

  • Use setInterval to set up a function to be run periodically.
  • The function would call panBy on the Google map object to "rotate" it a bit.

That should give you a simple animation that does what you want. You'd want to adjust the time interval that you give to setInterval to get something that feels smooth of course. You should have something like this:

// Create your map and leave it in the "map" variable.
setInterval(function() {
    map.panBy(x, 0);
}, n);

Choosing appropriate x and n values is up to you.

这篇关于Google地图可以设置为一个慢速常量锅吗?像全球革命一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆