Sorry. 请您稍等,正在加载/Loading...

添加Google Maps

[源自:色彩斑斓]

成功啦,原来作者的代码中多了两个空格,晕死。 看鱼做的示例.

1.像以前添加Google Ajax search一样,先到官方网站上申请一个Key,地址在这儿

2.备份你的模板。一定要注意这一步,不要出错的时候后悔莫及。

3.紧在</head>之前,添加下面代码。在这一步,我们可以设定默认的Google maps加载时的地点,要用到经纬度,可以通过Google earth得到。经纬度格式示例:4.700000, 52.300000

我实在没办法了,因为只要把代码复制到这上面,就不能正常显示,因此放在了一个文本区域中,如果还不行,那么建议你不要添加了,因为用处不大

<script src="'http://maps.google.com/maps?file="api&v="2&key="申请到的Key'" type="'text/javascript'/"><br /><br /><script src="'http://www.google.com/uds/api?file="uds.js&amp;v="1.0&source ="uds-msw&key="申请到的Key'" type="'text/javascript'/"><br /><br /><script type="'text/javascript'"><br /><br />function LoadMap() {<br /><br />var map = new GMap(document.getElementById("map"));<br /><br />map.centerAndZoom(new GPoint(经度, 纬度), 3);<br /><br />var point = new GPoint(经度, 纬度);<br /><br />var markertext = "关于此地点的信息";<br /><br />var marker = new GMarker(point);<br /><br />GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(markertext);});<br /><br />map.addOverlay(marker);<br /><br />}<br /><br />GSearch.setOnLoadCallback(LoadMap);<br /><br /></script>

4.保存模板,可能会弹出错误提示,可以忽略,因为你申请的Key是为你的Blog地址,而此时的地址是beta.blogger.com

5.现在你只要粘贴下面代码就可以把地图放在文章或侧边栏里了。

<div id="map" style="width:360px; height:260px; border:solid 1px #000000;">Loading map...</div>

via BeautifulBeta


Power by WOW派™

1 评论:

123 说...

The new owners appear that they were committed to bringing out 250 new styles every year at a minimum, and Replica Chopard accept now become accessible at over 5,000 food throughout the world. The Nationwide Aggregation has aswell amorphous to advertise Croton designs on TV arcade networks such as ShopNBC.

相关文章