【问题标题】:How to set the "Google Earth Plugin" view as default in a Google Maps iframe?如何在谷歌地图 iframe 中将“谷歌地球插件”视图设置为默认视图?
【发布时间】:2013-08-21 18:04:19
【问题描述】:

我正在使用这个Example,我想将 Google EARTH 设置为默认视图。

【问题讨论】:

    标签: google-maps iframe google-earth google-earth-plugin


    【解决方案1】:

    使用 setMapType 设置所需的地图类型:

     map.setMapType(G_SATELLITE_3D_MAP);
    

    <edit>:

    链接的示例使用 Maps-API V2,对于 V3,它有点不同。等待地图的空闲事件并将 mapType 设置为 'GoogleEarthAPI' 。

    转到文档的第 116 行并修改它:

    if (isGEinstalled)
    {
    googleEarth = new GoogleEarth(map);
    //add the following line
    google.maps.event.addListenerOnce(map,'idle',function(){map.setMapTypeId('GoogleEarthAPI')});
    }
    else
    {
      alert("O plugin de Google Earth não está instalado");
    }
    

    【讨论】:

    • 你能帮帮我吗?我在这张地图上试过,但没有用,你能告诉我应该在 JS 的哪一行添加它吗? j.mp/167CcJP 第 84 行是否正确?但它没有用。
    • 太棒了!简单有效。
    猜你喜欢
    • 2020-09-02
    • 2014-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-11
    • 2017-09-02
    • 2016-12-06
    • 2016-06-06
    相关资源
    最近更新 更多