方法:
1、到 http://code.google.com/intl/zh-CN/apis/maps/signup.html 去申请自己网站的Google Maps API密钥;
2、到 http://code.google.com/intl/zh-CN/apis/earth/documentation/index.html 去学习Google地球API开发人员指南;
3、在WordPress后台找到外观 - 编辑 - 顶部(header.php),将下面这段插入到<!--header END-->之前:

//ABCDE是你的Google Map API   
<script src="https://www.google.com/jsapi?key=ABCDE"></script>   
   <script type="text/javascript">   
      var ge;   
      google.load("earth", "1");   
  
      function init() {   
         google.earth.createInstance('map3d', initCB, failureCB);   
      }   
  
      function initCB(instance) {   
         ge = instance;   
         ge.getWindow().setVisibility(true);   
      }   
  
      function failureCB(errorCode) {   
      }   
  
      google.setOnLoadCallback(init);   
</script>

4、将下面这段插入到你的任意一篇新文章或页面中:

<div id="map3d" style="height: 400px; width: 600px;"></div>

5、如果要更多效果(例如在地球上显示某个坐标),请参考第2条中的链接地址,里面有大量的教程。

另外,关于如何在WordPress博客插入Google Earth地图,请参见《谷歌地图(Google Map)中iframe实现跳转新窗口打开链接功能》。

方法:
1、到 http://code.google.com/intl/zh-CN/apis/maps/signup.html 去申请自己网站的Google Maps API密钥;
2、到 http://code.google.com/intl/zh-CN/apis/earth/documentation/index.html 去学习Google地球API开发人员指南;
3、在WordPress后台找到外观 - 编辑 - 顶部(header.php),将下面这段插入到<!--header END-->之前:

//ABCDE是你的Google Map API   
<script src="https://www.google.com/jsapi?key=ABCDE"></script>   
   <script type="text/javascript">   
      var ge;   
      google.load("earth", "1");   
  
      function init() {   
         google.earth.createInstance('map3d', initCB, failureCB);   
      }   
  
      function initCB(instance) {   
         ge = instance;   
         ge.getWindow().setVisibility(true);   
      }   
  
      function failureCB(errorCode) {   
      }   
  
      google.setOnLoadCallback(init);   
</script>

4、将下面这段插入到你的任意一篇新文章或页面中:

<div id="map3d" style="height: 400px; width: 600px;"></div>

5、如果要更多效果(例如在地球上显示某个坐标),请参考第2条中的链接地址,里面有大量的教程。

另外,关于如何在WordPress博客插入Google Earth地图,请参见《谷歌地图(Google Map)中iframe实现跳转新窗口打开链接功能》。

共有 10 条评论

  1. S

    江苏

    is it? i don't think so... anyway thx for making it as ur favorite..

    十三年前 Firefox 3 · Windows 7

    回复

  2. ric83311

    上海

    I'm very lazy on this kind of thing now, I was fond of these when I was young, ahahahaha....

    十三年前 Maxthon 2 · Windows XP

    回复

  3. ric83311

    上海

    Oh, complicated, keep it as the favorite at least...

    十三年前 Maxthon 2 · Windows XP

    回复

       

回复 ric83311 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注