首頁 » 聯系我們 » 國(guó)內(nèi)
咨詢
![]() |
杭州中信泰和數碼科技有限公司 地(dì)址:中國(guó)上(shàng)海(hǎiλφ> )市(shì)奉賢區(qū)青村(cūn)鎮上(shàng)☆Ω塑路(lù)1959号 郵政編碼: 201414 電(diàn)話(huà): 86-21-54881966 傳真: 86-21-54889946 |
市(shì)場(chǎng)部 | 售後服務部 | |||
市(shì)場(chǎng)部:賈海(hǎiα>•)濤 | 技(jì)服部:宋傑 | |||
手機(jī): 0086-180171922•↔∏≥11 | 手機(jī): 86-18017197722 | |||
電(diàn)話(huà): ε₹86-21-54881966-8078 | 電(diàn)話(huà): 86-21-54881966-8&↓₽722 | |||
傳真:86-21-54881966-8078®$ | 傳真: 86-21-54881617 | |||
電(diàn)子(zǐ)郵件(jiàn): 2880677220@qq.com | 電(diàn)子(zǐ)郵件(jiàn): 2880677235@qq.com | |||
QQ: 2880677220 |
QQ: 2880677235 |
<!DOCTYPE html PUBLI±× >C "-//W3C//DTD XHTML 1.0 Transitional₹₽✔←//EN" "http://www.w3.org/TR/xhtm$♣δl1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://ww₹εw.w3.org/1999/xhtml">
<head>
<meta http-equiv="CoΩ♣ε♦ntent-Type" content="text/→π∏html; charset=gb2312" />
<meta name="keyword∑£§♠s" content="百度地(dì)圖→≠☆,百度地(dì)圖API,百度地(dì)圖自(zì)定ε δ§義工(gōng)具,百度地(dì)圖所見(jiàn)即所得(de)工(gōng )具" />
<meta name="descript♣₩© ion" content="百度地(dì)圖API自(zì)定義地(dì)圖,π✘σφ幫助用(yòng)戶在可(kě)視(shì)化(hu®×γβà)操作(zuò)下(xià)生(shēng)成百度地(dì)圖" /> ♠∑
<title>百度地(dì)圖API自(zì)定義地(dì)圖&©Ωlt;/title>
<!--引用(yòng)百度地(dì)圖API-->
<style type="text/cs♠↓s">
html♥→,body{margin:0;padding:0;}
.↕™≈iw_poi_title {color:✔σ<≤#CC5522;font-size:14px;font-weigh γ£t:bold;overflow:hidden;p>•adding-right:13px;white-space:nowrap}
.iw_poi_♣↓δcontent {font:12px arial,sans-serif;o¥γverflow:visible;padding-top:4px;white™✘♠-space:-moz-pre-wrap;word-wrap:break-wσ"✔ord}
</style>
<script type="tex€÷∞t/javascript" src="http://api.map.↑☆♠☆baidu.com/api?key=&v=1.1↑§β÷&services=true"></script&δ≥gt;
</head>
<body>
<!--百度地(dì)圖容器(qì)--&σφ±gt;
<div style="wδ£>↑idth:697px;height:550px•;border:#ccc solid 1px;" id="ditu☆∞↔<Content"></div>
</body>
<script type="text/javascript">$α≥;
//創建和(hé)初始化(huà)地(★dì)圖函數(shù):
functionπ≈ initMap(){
&nbs©®p; createMap();∞♦//創建地(dì)圖
≠ setMapEvent();//設置地(dì)圖事(shì)♦'>件(jiàn)
&n£"₽bsp; addMapControl();//向地(dì)圖添加控件(¥εjiàn)
& πnbsp; addMarker();//向地>↓β"(dì)圖中添加marker
}
//創建地(dì)圖函數(shù):>π<
func&δ₽tion createMap(){
&<Ωnbsp; var map & = new BMap.Map("dituContent");//在百度地(d♦↕δβì)圖容器(qì)中創建一(yī)個(gè)地(dì)圖
&nbs<•p; var point = new BMap δ.Point(121.565057,30.923209);//定義一¶£(yī)個(gè)中心點坐(zuò)标
&nbs≤≥♣★p; ma♥"p.centerAndZoom(point,18);//設定地δ☆↔(dì)圖的(de)中心點和(hé)坐(÷zuò)标并将地(dì)圖顯示在地(dì)圖容器(qì)中±₹∞
 σ©↑ ; window.map = map;//将mΩ™ap變量存儲在全局
}
//地π噥(dì)圖事(shì)件(jiàn)設置函數(shù):
function setM∑apEvent(){
&nb♦↕☆sp; map.enableDragging();≈♥>®//啓用(yòng)地(dì)圖拖拽事(s↔εhì)件(jiàn),默認啓用(yòng)(可(kě→→®)不(bù)寫)
&÷↔↕÷nbsp; map.enabl☆•eScrollWheelZoom();//啓用(yòng)地♣λ(dì)圖滾輪放(fàng)大(dà)縮小(xiǎo)
&nb∞®∏≤sp; map.enβ↕×∑ableDoubleClickZoom();//啓用(yòng)鼠↕♠标雙擊放(fàng)大(dà),默認啓用(yò®×≥ng)(可(kě)不(bù)寫)
←© mσ∑'βap.enableKeyboard();//啓用(yòng)鍵盤上(shàng§↕')下(xià)左右鍵移動地(dì)圖
}✔ε
//地(dì)圖控件(jiàn)添加函數≤γ(shù):
function a¥≤φddMapControl(){
↕±≈ //向地(dì)圖中 ✔§添加縮放(fàng)控件(jiàn)
var ctrl_nav = ™♣♦new BMap.NavigationControl({anchor:BM≠'AP_ANCHOR_TOP_LEFT,type:BMAP_NA" ®©VIGATION_CONTROL_LARGE});
map.a≈ ∞ddControl(ctrl_nav);
&nλ♦bsp; //向地(dì)圖中添加縮略圖控件(jià≤∑↑n)
var ctrl_ove = ne☆→w BMap.OverviewMapControl({anchor:BMA÷•>P_ANCHOR_BOTTOM_RIGHT,isOpen:1});
map.addControl(c×€trl_ove);
&nbs✔£p; //向地(dì)圖中添加比例尺控件Ω♣(jiàn)
var ↓ctrl_sca = new BMap.ScaleControl({ancho♠✔r:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(ctβ¥rl_sca);
}≈™
//标注點數(shù)組
var marker$®£Arr = [{title:"Wit-Color"≥Ω$₽,content:"Address:No. 1959&α≈ ≥;nbsp;Shangsu&nbsπ∑p;Road, Qin≈ ₽gcun Town, Fengxian&¥☆amp;nbsp;District, Sha©★↔×nghai, China.201414<br/>← •;Tel:+86-21-54881966,&∑₽ nbsp;Mob.:+86-18017197700",point:"121.£π≠564774|30.923248",isOpen:0,i"€×♦con:{w:21,h:21,l:0,t:0,x:6,lb:5}}
&£ε ♠nbsp; ];
//創建marker
function addMarker>"$♦(){
&n ↓♦bsp;  ≤; for(var i=0;i<markerArr.len±§Ωgth;i++){
&÷®nbsp; &nbsΩ₽¶p; var json = markerArr[i];
¥♦←$  ♠φ±; var p0 = json.point.♦γ✔±split("|")[0];
&nbs≤←σp; &nbsσ← p; var p1 = json.poi• " nt.split("|")[1];
&n≥α€bsp;   &∏≠; var poin₹λ t = new BMap.Point(p0,p1);
&☆ ★nbsp; &εβnbsp; var iconIm↔ g = createIcon(json.σ₹ icon);
&nb∏∏₩πsp; &nbs₽™σ∑p; var marker = new ☆∞BMap.Marker(point,{icon:iconImg});
&nbs✘☆p; 뮥£ var iw = createInfoWi↓♦∑€ndow(i);
 €φ© ; &nbs←≠∏p; var label = new BMap.Label$≈(json.title,{"offset":new ♠"&×BMap.Size(json.icon.lb-π÷★json.icon.x+10,-20)});
&nσ♦bsp; mark←☆®er.setLabel(label);
&n∞&bsp; &nb→"sp; map.addOverlay(m×ε"≤arker);
&nb™≥sp; la¥£δbel.setStyle({
&nb•✔sp; &nbsε→§p;  •≤→↔; &nb≠¶αεsp; borderColor:"#808080",
&nb§≠sp; &α∑γnbsp; ↑←×ε  >&; color:"#333",
&nb'®←sp;   ≈✘←; &nb™ γsp; ★ cursor:"poin®ter"
&n↑↕bsp; α€ })☆<✘;
&nb'Ω sp; &÷ ÷₽nbsp;
&n≥π♥bsp; &n★↓∏πbsp; (function(){
 ∑>↔£; &nb≤≈±sp; va★σr index = i;
•δ' &♣ nbsp; >✔ var _iw = createInfoWindow䶱∞(i);
&nbs≈p; &n♥"bsp; var £↓₽_marker = marker;
&nbsσλγp; &n≈€♠bsp; ★ _marker.addEventListe®×'∞ner("click",function(){
&↕  &n← bsp;  β↕; this.openInfoWindo↕™↔w(_iw);
φ∞> &nb★← sp;  ©σ ©; });
&nbsγαp; &≥ nbsp; &nb∏₽sp; _iw.addEventList¥λ&ener("open",function(){
&nbs >€&p; &™γnbsp; &n↕♣bsp; &nbs♣'p; _marker.getLabel().hide();
 ≈✔☆; &nbsφ✘p; })
&nσ≠bsp;  ☆≠♠β; _iw.addEventLi♥π→÷stener("close",function(){
&n$₹bsp; ♦↕  ™∑&; &nb ©sp; _marker.getLabel().sh € ow();
&nb¥™sp; &nbsα ÷p; })
&nbs∑↔p;  ≈∏; β←←label.addEventListener("click",func€σ♥tion(){
£¥& &nbsε©p; &γnbsp;  σα♣; _marker.openInfoWindow(_iw);
&nb≤€↓↑sp; &nbα♦sp;  ♦γ§; })
&nb ↕£'sp; &nb↕'₽sp; &nbs✘→✔p; if(!!json.isOpen){
&nββbsp; ✔≠λ  ∑; label.hide()₽♠÷;
&n₩<↑∑bsp; &n₹שbsp; &σπ↑nbsp; _marke≤ r.openInfoWindow(_iw);
&$↔λΩnbsp; &nφ♠¶bsp; &nb☆♠sp; }
&n≤πbsp; &n↕✔bsp; })()
&πδ∏εnbsp; }
}
//創建InfoWindow
functionα♥λ createInfoWindow(i){
&nbs←¶™•p; var jsonΩ♠ & = markerArr[i];
&nb∞>×±sp; var iw = new BMap.Info×δWindow("<b class='iw_p ≤oi_title' title='" + json.t♦↓itle + "'>" + json.title₩→ + "</b><div class=γ"β'iw_poi_content'>"+json.content+"π₹ε♠</div>");
&→ ∞✔nbsp; return iw;
}
//創♦★↔建一(yī)個(gè)Icon
function♠∑↓ createIcon(json){
&nb©≤βsp; var icon = new BMap.Ico≈n("http://app.baidu.com/map/images/us_₩φ≤mk_icon.png", new BMap.Size(json.γ®≠w,json.h),{imageOffset: new BMap.Size(≈®∞-json.l,-json.t),infoWindowOffset:ne♣≠₹w BMap.Size(json.lb+5,1),offset:new B®®↔≤Map.Size(json.x,json.h)})
&nbs•α♦p; return i×∏con;
}
initMap();//創建 ÷¶♠和(hé)初始化(huà)地(dì)圖
</script>
</html>
<html xmlns="http://ww₹εw.w3.org/1999/xhtml">
<head>
<meta http-equiv="CoΩ♣ε♦ntent-Type" content="text/→π∏html; charset=gb2312" />
<meta name="keyword∑£§♠s" content="百度地(dì)圖→≠☆,百度地(dì)圖API,百度地(dì)圖自(zì)定ε δ§義工(gōng)具,百度地(dì)圖所見(jiàn)即所得(de)工(gōng )具" />
<meta name="descript♣₩© ion" content="百度地(dì)圖API自(zì)定義地(dì)圖,π✘σφ幫助用(yòng)戶在可(kě)視(shì)化(hu®×γβà)操作(zuò)下(xià)生(shēng)成百度地(dì)圖" /> ♠∑
<title>百度地(dì)圖API自(zì)定義地(dì)圖&©Ωlt;/title>
<!--引用(yòng)百度地(dì)圖API-->
<style type="text/cs♠↓s">
html♥→,body{margin:0;padding:0;}
.↕™≈iw_poi_title {color:✔σ<≤#CC5522;font-size:14px;font-weigh γ£t:bold;overflow:hidden;p>•adding-right:13px;white-space:nowrap}
.iw_poi_♣↓δcontent {font:12px arial,sans-serif;o¥γverflow:visible;padding-top:4px;white™✘♠-space:-moz-pre-wrap;word-wrap:break-wσ"✔ord}
</style>
<script type="tex€÷∞t/javascript" src="http://api.map.↑☆♠☆baidu.com/api?key=&v=1.1↑§β÷&services=true"></script&δ≥gt;
</head>
<body>
<!--百度地(dì)圖容器(qì)--&σφ±gt;
<div style="wδ£>↑idth:697px;height:550px•;border:#ccc solid 1px;" id="ditu☆∞↔<Content"></div>
</body>
<script type="text/javascript">$α≥;
//創建和(hé)初始化(huà)地(★dì)圖函數(shù):
functionπ≈ initMap(){
&nbs©®p; createMap();∞♦//創建地(dì)圖
≠ setMapEvent();//設置地(dì)圖事(shì)♦'>件(jiàn)
&n£"₽bsp; addMapControl();//向地(dì)圖添加控件(¥εjiàn)
& πnbsp; addMarker();//向地>↓β"(dì)圖中添加marker
}
//創建地(dì)圖函數(shù):>π<
func&δ₽tion createMap(){
&<Ωnbsp; var map & = new BMap.Map("dituContent");//在百度地(d♦↕δβì)圖容器(qì)中創建一(yī)個(gè)地(dì)圖
&nbs<•p; var point = new BMap δ.Point(121.565057,30.923209);//定義一¶£(yī)個(gè)中心點坐(zuò)标
&nbs≤≥♣★p; ma♥"p.centerAndZoom(point,18);//設定地δ☆↔(dì)圖的(de)中心點和(hé)坐(÷zuò)标并将地(dì)圖顯示在地(dì)圖容器(qì)中±₹∞
 σ©↑ ; window.map = map;//将mΩ™ap變量存儲在全局
}
//地π噥(dì)圖事(shì)件(jiàn)設置函數(shù):
function setM∑apEvent(){
&nb♦↕☆sp; map.enableDragging();≈♥>®//啓用(yòng)地(dì)圖拖拽事(s↔εhì)件(jiàn),默認啓用(yòng)(可(kě→→®)不(bù)寫)
&÷↔↕÷nbsp; map.enabl☆•eScrollWheelZoom();//啓用(yòng)地♣λ(dì)圖滾輪放(fàng)大(dà)縮小(xiǎo)
&nb∞®∏≤sp; map.enβ↕×∑ableDoubleClickZoom();//啓用(yòng)鼠↕♠标雙擊放(fàng)大(dà),默認啓用(yò®×≥ng)(可(kě)不(bù)寫)
←© mσ∑'βap.enableKeyboard();//啓用(yòng)鍵盤上(shàng§↕')下(xià)左右鍵移動地(dì)圖
}✔ε
//地(dì)圖控件(jiàn)添加函數≤γ(shù):
function a¥≤φddMapControl(){
↕±≈ //向地(dì)圖中 ✔§添加縮放(fàng)控件(jiàn)
var ctrl_nav = ™♣♦new BMap.NavigationControl({anchor:BM≠'AP_ANCHOR_TOP_LEFT,type:BMAP_NA" ®©VIGATION_CONTROL_LARGE});
map.a≈ ∞ddControl(ctrl_nav);
&nλ♦bsp; //向地(dì)圖中添加縮略圖控件(jià≤∑↑n)
var ctrl_ove = ne☆→w BMap.OverviewMapControl({anchor:BMA÷•>P_ANCHOR_BOTTOM_RIGHT,isOpen:1});
map.addControl(c×€trl_ove);
&nbs✔£p; //向地(dì)圖中添加比例尺控件Ω♣(jiàn)
var ↓ctrl_sca = new BMap.ScaleControl({ancho♠✔r:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(ctβ¥rl_sca);
}≈™
//标注點數(shù)組
var marker$®£Arr = [{title:"Wit-Color"≥Ω$₽,content:"Address:No. 1959&α≈ ≥;nbsp;Shangsu&nbsπ∑p;Road, Qin≈ ₽gcun Town, Fengxian&¥☆amp;nbsp;District, Sha©★↔×nghai, China.201414<br/>← •;Tel:+86-21-54881966,&∑₽ nbsp;Mob.:+86-18017197700",point:"121.£π≠564774|30.923248",isOpen:0,i"€×♦con:{w:21,h:21,l:0,t:0,x:6,lb:5}}
&£ε ♠nbsp; ];
//創建marker
function addMarker>"$♦(){
&n ↓♦bsp;  ≤; for(var i=0;i<markerArr.len±§Ωgth;i++){
&÷®nbsp; &nbsΩ₽¶p; var json = markerArr[i];
¥♦←$  ♠φ±; var p0 = json.point.♦γ✔±split("|")[0];
&nbs≤←σp; &nbsσ← p; var p1 = json.poi• " nt.split("|")[1];
&n≥α€bsp;   &∏≠; var poin₹λ t = new BMap.Point(p0,p1);
&☆ ★nbsp; &εβnbsp; var iconIm↔ g = createIcon(json.σ₹ icon);
&nb∏∏₩πsp; &nbs₽™σ∑p; var marker = new ☆∞BMap.Marker(point,{icon:iconImg});
&nbs✘☆p; 뮥£ var iw = createInfoWi↓♦∑€ndow(i);
 €φ© ; &nbs←≠∏p; var label = new BMap.Label$≈(json.title,{"offset":new ♠"&×BMap.Size(json.icon.lb-π÷★json.icon.x+10,-20)});
&nσ♦bsp; mark←☆®er.setLabel(label);
&n∞&bsp; &nb→"sp; map.addOverlay(m×ε"≤arker);
&nb™≥sp; la¥£δbel.setStyle({
&nb•✔sp; &nbsε→§p;  •≤→↔; &nb≠¶αεsp; borderColor:"#808080",
&nb§≠sp; &α∑γnbsp; ↑←×ε  >&; color:"#333",
&nb'®←sp;   ≈✘←; &nb™ γsp; ★ cursor:"poin®ter"
&n↑↕bsp; α€ })☆<✘;
&nb'Ω sp; &÷ ÷₽nbsp;
&n≥π♥bsp; &n★↓∏πbsp; (function(){
 ∑>↔£; &nb≤≈±sp; va★σr index = i;
•δ' &♣ nbsp; >✔ var _iw = createInfoWindow䶱∞(i);
&nbs≈p; &n♥"bsp; var £↓₽_marker = marker;
&nbsσλγp; &n≈€♠bsp; ★ _marker.addEventListe®×'∞ner("click",function(){
&↕  &n← bsp;  β↕; this.openInfoWindo↕™↔w(_iw);
φ∞> &nb★← sp;  ©σ ©; });
&nbsγαp; &≥ nbsp; &nb∏₽sp; _iw.addEventList¥λ&ener("open",function(){
&nbs >€&p; &™γnbsp; &n↕♣bsp; &nbs♣'p; _marker.getLabel().hide();
 ≈✔☆; &nbsφ✘p; })
&nσ≠bsp;  ☆≠♠β; _iw.addEventLi♥π→÷stener("close",function(){
&n$₹bsp; ♦↕  ™∑&; &nb ©sp; _marker.getLabel().sh € ow();
&nb¥™sp; &nbsα ÷p; })
&nbs∑↔p;  ≈∏; β←←label.addEventListener("click",func€σ♥tion(){
£¥& &nbsε©p; &γnbsp;  σα♣; _marker.openInfoWindow(_iw);
&nb≤€↓↑sp; &nbα♦sp;  ♦γ§; })
&nb ↕£'sp; &nb↕'₽sp; &nbs✘→✔p; if(!!json.isOpen){
&nββbsp; ✔≠λ  ∑; label.hide()₽♠÷;
&n₩<↑∑bsp; &n₹שbsp; &σπ↑nbsp; _marke≤ r.openInfoWindow(_iw);
&$↔λΩnbsp; &nφ♠¶bsp; &nb☆♠sp; }
&n≤πbsp; &n↕✔bsp; })()
&πδ∏εnbsp; }
}
//創建InfoWindow
functionα♥λ createInfoWindow(i){
&nbs←¶™•p; var jsonΩ♠ & = markerArr[i];
&nb∞>×±sp; var iw = new BMap.Info×δWindow("<b class='iw_p ≤oi_title' title='" + json.t♦↓itle + "'>" + json.title₩→ + "</b><div class=γ"β'iw_poi_content'>"+json.content+"π₹ε♠</div>");
&→ ∞✔nbsp; return iw;
}
//創♦★↔建一(yī)個(gè)Icon
function♠∑↓ createIcon(json){
&nb©≤βsp; var icon = new BMap.Ico≈n("http://app.baidu.com/map/images/us_₩φ≤mk_icon.png", new BMap.Size(json.γ®≠w,json.h),{imageOffset: new BMap.Size(≈®∞-json.l,-json.t),infoWindowOffset:ne♣≠₹w BMap.Size(json.lb+5,1),offset:new B®®↔≤Map.Size(json.x,json.h)})
&nbs•α♦p; return i×∏con;
}
initMap();//創建 ÷¶♠和(hé)初始化(huà)地(dì)圖
</script>
</html>