是否有任何解决方法可以禁用“缩放时自动倾斜"?谷歌地球插件的功能? [英] Is there any workaround for disabling the "auto tilt when zooming" feature of the Google Earth plugin?

查看:61
本文介绍了是否有任何解决方法可以禁用“缩放时自动倾斜"?谷歌地球插件的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近版本的 Google 地球附带了一项名为缩放时自动倾斜"的功能.如果启用,Google 地球会在您靠近地表时自动将相机倾斜到地平线.可以从 GUI 中禁用此功能(首选项 -> 导航选项卡).不幸的是,到目前为止,我还没有找到为 Google 地球插件禁用它的方法.

Recent versions of Google Earth are shipping with a feature called "Auto tilt when zooming". If enabled, Google earth automatically tilts the camera towards the horizon as you zoom closer to the surface. This feature can be disabled from within the GUI (Preferences -> Navigation tab). Unfortunately, I have so far not found a way to disable it for the Google Earth plugin.

似乎客户端设置对应于一个注册表项 (HKCU\Software\Google\Google Earth Plus\SwoopEnabled).在 Google Earth Plugin 注册表分支 (HKCU\Software\Google\GoogleEarthPlugin\SwoopEnabled) 中存在一个同名的键,但是,将值false"分配给它根本不起作用.与客户端不同,该插件似乎不评估设置.

Aseemingly the client setting corresponds to a registry key (HKCU\Software\Google\Google Earth Plus\SwoopEnabled). There exists a key of the same name inside the Google Earth Plugin registry branch (HKCU\Software\Google\GoogleEarthPlugin\SwoopEnabled), however, assigning the value "false" to it has no effect at all. It seems the plugin does not evaluate the setting, unlike the client.

有一个 API 方法可以禁用地平面自动过渡 (void GEOptions.setAutoGroundLevelViewEnabled(bool)),但这不会禁用自动倾斜行为.没有像GEOptions.setSwoopEnabled(bool)"这样的方法,尽管在我看来,拥有一个很有意义.

There is an API method for disabling the ground level auto transition (void GEOptions.setAutoGroundLevelViewEnabled(bool)), however this does not disable the auto tilt behavior. There is no such method as "GEOptions.setSwoopEnabled(bool)", even though it seems to me that it would make a lot of sense to have one.

Google Earth API 问题跟踪器将此问题列为问题:

The Google Earth API Issue Tracker lists this problem as an issue:

http://code.google.com/p/earth-api-samples/issues/detail?id=23

然而,该条目是 2008 年 8 月的,在我看来,Google 不太可能很快修复它.因此,我的问题是:是否有任何解决方法/hack/tweak.. 来强制插件禁用烦人的自动倾斜功能?

However, the entry is from August 2008 and it seems unlikely to me that Google will fix it any time soon. Therefore, my question is: Is there any sort of workaround/hack/tweak.. to force the plugin to disable the annoying auto-tilt feature?

任何帮助将不胜感激!

推荐答案

不,AFAIK 无法禁用此行为.

No, AFAIK it is not possible to disable this behaviour.

...也就是说,如果视图高度低于特定高度,您可以可能使用一些事件和条件逻辑以编程方式设置倾斜度.然而,这可能会引入其他问题,例如在一定高度以下根本无法倾斜视图.虽然这对于您的实现来说可能是可以接受的...

...That said you could possibly use some events and conditional logic to set the tilt programmatically if the view altitude is below a certain height. However this could introduce other issues, like not being able to tilt the view at all below a certain altitude. Although maybe that is acceptable for your implementation...

无论如何,以下内容可能对您有用,尽管它写在这里并且未经测试.

Anyhow, something like the following might work for you, although it is written here and is untested.

google.earth.addEventListener(ge, 'frameend', setView);

var setView = function() {
  var camera = ge.getView().copyAsCamera(ge.ALTITUDE_RELATIVE_TO_GROUND);
  if(camera.getAltitude() < BASE_ALTITUDE && camera.getTilt() >= AUTO_TILT_AMMOUNT) {
     var speed = ge.getOptions().getFlyToSpeed();
     ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);
     camera.setTilt(0);
     ge.getView().setAbstractView(camera);
     ge.getOptions().setFlyToSpeed(speed);
  }
}

其中 BASE_ALTITUDE 是 'swoop' 开始的高度,AUTO_TILT_AMMOUNT 是 'swoop' 俯冲后的倾斜值.

Where BASE_ALTITUDE is the height at which 'swoop' kicks in and AUTO_TILT_AMMOUNT is the tilt value once the 'swoop' has, err, swooped.

这篇关于是否有任何解决方法可以禁用“缩放时自动倾斜"?谷歌地球插件的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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