最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

SOSO地圖JS畫出標(biāo)注和中心點(diǎn)以html形式運(yùn)行

 更新時(shí)間:2013年08月09日 17:29:36   作者:  
SOSO地圖想必大家都知道吧,本文將為大家詳細(xì)介紹下使用JS畫出標(biāo)注和中心點(diǎn),直接貼出代碼,感興趣的朋友可以參考下
直接貼出代碼,這個(gè)可以在本地創(chuàng)建一個(gè)html文件直接運(yùn)行:
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Map</title>
<script charset="utf-8" src="http://map.soso.com/api/v2/main.js"></script>
<script>
function init() {
var center = new soso.maps.LatLng(31.15953,121.516035);
var map = new soso.maps.Map(
document.getElementById("container"),
{
center: center,//顯示地圖的中心位置
zoom: 15//顯示地圖的縮放級別
}
);

//地圖第一個(gè)mark的坐標(biāo)
var position1 = new soso.maps.LatLng(31.15751,121.514061);

var marker = new soso.maps.Marker({
position: position1,
map: map
});

//地圖第二個(gè)mark的坐標(biāo)
var position2 = new soso.maps.LatLng(31.160705,121.524017);

var marker = new soso.maps.Marker({
position: position2,
map: map
});

}
function loadScript() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://map.soso.com/api/v2/main.js?callback=init";
document.body.appendChild(script);
}
window.onload = loadScript;
</script>
</head>
<body onload="init()">
<div id="container" style="width:1000px; height:800px"></div>
</body>
</html>

相關(guān)文章

最新評論

凉城县| 哈密市| 临海市| 河北省| 什邡市| 普兰县| 沽源县| 霍林郭勒市| 永新县| 博爱县| 鄱阳县| 遂平县| 句容市| 冀州市| 通海县| 北海市| 达拉特旗| 武清区| 普定县| 万安县| 娄烦县| 隆昌县| 新沂市| 广安市| 汤原县| 甘德县| 淅川县| 皮山县| 庆安县| 榆树市| 建阳市| 宜川县| 鹤岗市| 沂水县| 雅江县| 凤山市| 黎城县| 封丘县| 荥阳市| 信宜市| 安陆市|