首頁 » 聯系我們 » 國(guó)內(nèi)
咨詢
![]() |
杭州中信泰和數碼科技有限公司 地(dì)址:中國(guó)上(shàng)海(hǎi≠₩§)市(shì)奉賢區(qū)青村(cūn)鎮上(shàng)塑路(lù)1≈≈£959号 郵政編碼: 201414 電(diàn)話(huà): 86-21-54881966 傳真: 86-21-54889946 |
市(shì)場(chǎng)部 | 售後服務部 | |||
市(shì)場(chǎng)部:賈海(hǎi)濤 | 技(jì)服部:宋傑 | |||
手機(jī): 0086-1801719₹ 2211 | 手機(jī): 86-18017197722 | |||
電(diàn)話(huà): 8>γ↕6-21-54881966-8078 | 電(diàn)話(huà): ∞✘£86-21-54881966-8722 | |||
傳真: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 PUBLIC'λ "-//W3C//DTD XHTML 1.0←γ Transitional//EN" "http://www.w3.orπ™∞∑g/TR/xhtml1/DTD/xhtml1-transit§πional.dtd">
<html xmlns="http://www.w3.org/1¶999/xhtml">
<head>
<meta http-equiv="Content-T¶↓✘ype" content="text/html; charset=gb231α∑π2" />
<meta name="keywords" content="百γ €•度地(dì)圖,百度地(dì)圖API,百度地"ε(dì)圖自(zì)定義工(gōng)具,百度地(dì)圖所見(j₽↑<♦iàn)即所得(de)工(gōng)具" />>♥☆;
<meta name="descrip§©tion" content="百度地(dì)圖API自(zì)定義地(dì)¥±♥δ圖,幫助用(yòng)戶在可(kě)視(shì±"λ)化(huà)操作(zuò)下(xià)生(shēng)成"♠百度地(dì)圖" />
<title>百度地(dì)圖API自(zì)定↔γ&✔義地(dì)圖</title>
<!--引用(yòng)百度地(dì)圖A≥σ×≈PI-->
<style type="text/css">
ht' ml,body{margin:0;padding:0;¥↕'}
.iw_poi_titl÷₩&★e {color:#CC5522;font-size:14px;font-we¥₽₩ight:bold;overflow:hi✔§dden;padding-right:13px;white-s♠αφpace:nowrap}
.iw_poi_c♣σ∞ontent {font:12px arial,sans-serif¶←;overflow:visible;padding-top<δ±:4px;white-space:-moz-pre-wrap÷↔≠£;word-wrap:break-word}
</style>
<script type="text/javascript" src="≤∞http://api.map.baidu.com/api?key=&a™∞mp;v=1.1&services=true"&g≠δ™"t;</script>
</head>
<body>
<!--百度地(dì)圖容σ☆器(qì)-->
<div style="width:697px;h₩¶♠<eight:550px;border:#ccc ™'solid 1px;" id="ditu♥↑>Content"></div>☆÷♠;
</body>
<script type="text/javascri$×π>pt">
//創建和(hΩ✔é)初始化(huà)地(dì)圖函數(shù):
function¶∏ initMap(){
&nΩ₽bsp; createMap();//創建地©÷₩(dì)圖
&nbs¥♦p; setMapEvent()€₽Ω;//設置地(dì)圖事(shì)件(jiàn)
∑σ addMapControl();/↑₹/向地(dì)圖添加控件(jiàn)
&nbφ→sp; addMarker()♥×™;//向地(dì)圖中添加marker
}
//創建地(dβ∑>ì)圖函數(shù):
function createMap★$γ(){
®α<∏ var map = new BMap.Map("β &φdituContent");//在百度地(dì)圖容器(qì)中創建一(yī♥£¶)個(gè)地(dì)圖
•§ var point = new BMΩλap.Point(121.565057,30.923209);/★€"/定義一(yī)個(gè)中心點坐(zuò)÷≤±标
&nb↑™↓✔sp; map.centerAndZoom(point∞≤,18);//設定地(dì)圖的(de)中心點和(hé)坐(zuò)标并将∑∑地(dì)圖顯示在地(dì)圖容器(qì)中
&nΩελbsp; window.map = maπ✘p;//将map變量存儲在全局
}
//地(dì)圖事(shì)件(Ω✘←jiàn)設置函數(shù):
function se≈γ✘tMapEvent(){
&© nbsp; map.enableDragging()♣γ∞;//啓用(yòng)地(dì)圖拖拽事(sh♠₽↔ì)件(jiàn),默認啓用(yòng)(可(kě)不(bù)寫)
&nbsσ αp; map.enableScrollWα>↔₩heelZoom();//啓用(yòng)地(dì"'¶)圖滾輪放(fàng)大(dà)縮小(xiǎo)
&nb¶≠φ&sp; map.enableDoub♥π leClickZoom();//啓用(yòng)鼠标雙擊放(fà★≠ng)大(dà),默認啓用(yòng)(可(kě)不(bù)寫)
&n"↕≈•bsp; map.enableKeyboard();//啓用(yò←"∏ ng)鍵盤上(shàng)下(xià)左右鍵移↔≠♦動地(dì)圖
}
//地(dì)圖控件★±(jiàn)添加函數(shù):
function addMapCo≤→©♦ntrol(){
&n≤&bsp; //向地(dì)圖中添加縮放(fàng)控件(j≈ ±✔iàn)
var ctrl_ קεnav = new BMap.NavigationControl↑♠±↓({anchor:BMAP_ANCHOR_TOP_LEFT,type:BM"↕×AP_NAVIGATION_CONTROL_L≈'ARGE});
map.ad&₹÷≤dControl(ctrl_nav);
 "₹§; //向地(dì)圖中添加∑₹縮略圖控件(jiàn)
var ctrl_o®♦ve = new BMap.OverviewMapControl({anch±₹±'or:BMAP_ANCHOR_BOTTO€₹M_RIGHT,isOpen:1});
map.addContro₩±δl(ctrl_ove);
 ∏₹β; //向地(dì)圖中添加比例尺控件(™¶λjiàn)
vβ♠¶ar ctrl_sca = new BMap.ScaleControl({a'$nchor:BMAP_ANCHOR_BOTTOM_LEFT});
map.add&×₩★Control(ctrl_sca);
}
//标注點數(shù)← ₩組
var markerArδ&♣✘r = [{title:"Wit-Color",¥αcontent:"Address:No. 1959&am÷σp;nbsp;Shangsu •§Road, Qingcun&am p;nbsp;Town, Fengxian$¶α↓ District,&nbs✘₩∑p;Shanghai, Chi'¥na.201414<br/>Tel:+86-21-54881↓↔966, Mob.:+86-18017197700≈α∑",point:"121.564774|30.923248",isOp¥±en:0,icon:{w:21,h:21,l✔€:0,t:0,x:6,lb:5}}
&∑' ];
//創建marker
functio≤"βn addMarker(){
&σ•♦nbsp; for(var i=0;i<markerArβ& r.length;i++){
&nb$♠£sp; & λπnbsp; var json = markerArr[i];
&n♦bsp;  ©♥↑; var p0 = json.point.split("|")[0];
₩→σ &nbδ★π≠sp; var p1 = json.point.split("|")[α♦₹₩1];
 ≠π'; &n<•βbsp; var point = new BMap.Point(↑<p0,p1);
&♠★nbsp; &nbε↓≠sp; var iconImg = createIcon(json.ico®∏n);
&← &nb®£sp; var m"™λarker = new BMap.Marker(point,{icon§ε:iconImg});
 ♠≥; &'≤♦nbsp; var iw = createInfo☆"Window(i);
&★₽  σ≈≤; var label = new BMap.Label(Ω δjson.title,{"offset":new BMap.Size(json€™Ω.icon.lb-json.icon.x+10,-20)});
&nbsδ ™p; £ marker.setLabel(label);
&n ✘δbsp; ∞↑↓ map.addOv≠→✘εerlay(marker);
&nbsλ ←≠p; &¶✔nbsp; label.←setStyle({
&>♣nbsp; &γ nbsp; &ε &nbε≈>γsp; &nb↕↕© sp; borderColor:"#808080",
 ∏±±; &≠ nbsp; &n ★↔÷bsp; &nbs∏α♥•p; &¶£₩nbsp; color:"#333",
 •Ω ; &n§♠"bsp; &nb₩φ≈∑sp;  ≈; cursor:"pointe₹ r"
&nb∞ sp; &nbs"→p; });
 <βγ✔; &nbs≥ <p;
&n↕φbsp; &✔©nbsp; (function(){
♦ &nbsσ♣p; σ£≈> var ind £↑ex = i;
&n™•<δbsp;  £± ;  ≥↓>; var _iw = createInfoWαα∑indow(i);
  π; &n bsp; $α var _marker = marker;
&nbs ₩®♣p;  ←↑φ; ♣≠α_marker.addEventListener("click",fu©> ↔nction(){
 ♥π"•; &nbs Ω♥∞p; &nbs ∏p; this.op✔✔∑₩enInfoWindow(_iw);
&σ∞nbsp; &nbs ↔p; });
&nbs₽ק§p; &nbs®↕→p; &₽ ₽nbsp; _iw.addEventListen¥"€er("open",function(){
&nb'₩αsp; &nb≥↑♥sp; &n®₩✔bsp; &←××nbsp; _marker.getLabel().hide();
&π>↕∏nbsp;  ♣✘←; &×&£nbsp; })
&nbsλ∑p; ✔★ ε★δ _iw.addEventListener("clo>≈↑se",function(){
&n≈™↕bsp;  ←≠♣; ⶧ &nΩ™bsp; _marker.getLabel().show();
&nbsγ←↑p; ♦§ &n₹®£₽bsp; })
&¥∞nbsp; &nb✘↕₹ sp; &nbs φ↓p; label.addEventListene →r("click",function(){
&n↑♣∏bsp; &&≠¥nbsp;  ¥δ≈; _marker.openInfoWφ∏φindow(_iw);
&∞≥★δnbsp; &nλ§πβbsp;  α∏αφ; })
&©Ωnbsp; &n✘'§☆bsp; if(!!json.isOpen<'♦){
 >∞®; &nb≈ ♠sp; &nσπ♦♣bsp; label.hide();
&nbα¶&↕sp; &nbs↕¶p; &εεnbsp; _marker.openInfoWindα☆•ow(_iw);
&•←←↓nbsp; &nb☆sp;  β₹₹™; }
&nbβ×∞±sp; &nbs₹₽¶p; })()
&✔σnbsp; }
}
//創建InfoWindow
function createI∑¥nfoWindow(i){
&nbs₽πp; var j₹₹≤son = markerArr[i];
&n× bsp; var iw = new BMap.InfoW→♥ indow("<b class='iw_p<£§÷oi_title' title='" + j↕∞¥son.title + "'>" + j±♠<son.title + "</b><diδ←v class='iw_poi_content'>"+json.contλ→ent+"</div>");
 £®♣×; return iw¥®;
}
//創建一(yī)個(gè)I¥♠con
function create•♠®αIcon(json){
 ₹✔; var ico ♥n = new BMap.Icon("http://a↔βγpp.baidu.com/map/images/us_mk_icon•".png", new BMap.Size(js☆→on.w,json.h),{imageOffset: new BMa₩↔♥€p.Size(-json.l,-json.t),infoWindowOffs≈£>et:new BMap.Size(json.lb+5,1),offset:↔'δnew BMap.Size(json.x,"&λ→json.h)})
 ♦γ♦✘; return icon;
}
initMap();/↑÷α/創建和(hé)初始化(huà)地(dì)圖
</script>
</html>
<html xmlns="http://www.w3.org/1¶999/xhtml">
<head>
<meta http-equiv="Content-T¶↓✘ype" content="text/html; charset=gb231α∑π2" />
<meta name="keywords" content="百γ €•度地(dì)圖,百度地(dì)圖API,百度地"ε(dì)圖自(zì)定義工(gōng)具,百度地(dì)圖所見(j₽↑<♦iàn)即所得(de)工(gōng)具" />>♥☆;
<meta name="descrip§©tion" content="百度地(dì)圖API自(zì)定義地(dì)¥±♥δ圖,幫助用(yòng)戶在可(kě)視(shì±"λ)化(huà)操作(zuò)下(xià)生(shēng)成"♠百度地(dì)圖" />
<title>百度地(dì)圖API自(zì)定↔γ&✔義地(dì)圖</title>
<!--引用(yòng)百度地(dì)圖A≥σ×≈PI-->
<style type="text/css">
ht' ml,body{margin:0;padding:0;¥↕'}
.iw_poi_titl÷₩&★e {color:#CC5522;font-size:14px;font-we¥₽₩ight:bold;overflow:hi✔§dden;padding-right:13px;white-s♠αφpace:nowrap}
.iw_poi_c♣σ∞ontent {font:12px arial,sans-serif¶←;overflow:visible;padding-top<δ±:4px;white-space:-moz-pre-wrap÷↔≠£;word-wrap:break-word}
</style>
<script type="text/javascript" src="≤∞http://api.map.baidu.com/api?key=&a™∞mp;v=1.1&services=true"&g≠δ™"t;</script>
</head>
<body>
<!--百度地(dì)圖容σ☆器(qì)-->
<div style="width:697px;h₩¶♠<eight:550px;border:#ccc ™'solid 1px;" id="ditu♥↑>Content"></div>☆÷♠;
</body>
<script type="text/javascri$×π>pt">
//創建和(hΩ✔é)初始化(huà)地(dì)圖函數(shù):
function¶∏ initMap(){
&nΩ₽bsp; createMap();//創建地©÷₩(dì)圖
&nbs¥♦p; setMapEvent()€₽Ω;//設置地(dì)圖事(shì)件(jiàn)
∑σ addMapControl();/↑₹/向地(dì)圖添加控件(jiàn)
&nbφ→sp; addMarker()♥×™;//向地(dì)圖中添加marker
}
//創建地(dβ∑>ì)圖函數(shù):
function createMap★$γ(){
®α<∏ var map = new BMap.Map("β &φdituContent");//在百度地(dì)圖容器(qì)中創建一(yī♥£¶)個(gè)地(dì)圖
•§ var point = new BMΩλap.Point(121.565057,30.923209);/★€"/定義一(yī)個(gè)中心點坐(zuò)÷≤±标
&nb↑™↓✔sp; map.centerAndZoom(point∞≤,18);//設定地(dì)圖的(de)中心點和(hé)坐(zuò)标并将∑∑地(dì)圖顯示在地(dì)圖容器(qì)中
&nΩελbsp; window.map = maπ✘p;//将map變量存儲在全局
}
//地(dì)圖事(shì)件(Ω✘←jiàn)設置函數(shù):
function se≈γ✘tMapEvent(){
&© nbsp; map.enableDragging()♣γ∞;//啓用(yòng)地(dì)圖拖拽事(sh♠₽↔ì)件(jiàn),默認啓用(yòng)(可(kě)不(bù)寫)
&nbsσ αp; map.enableScrollWα>↔₩heelZoom();//啓用(yòng)地(dì"'¶)圖滾輪放(fàng)大(dà)縮小(xiǎo)
&nb¶≠φ&sp; map.enableDoub♥π leClickZoom();//啓用(yòng)鼠标雙擊放(fà★≠ng)大(dà),默認啓用(yòng)(可(kě)不(bù)寫)
&n"↕≈•bsp; map.enableKeyboard();//啓用(yò←"∏ ng)鍵盤上(shàng)下(xià)左右鍵移↔≠♦動地(dì)圖
}
//地(dì)圖控件★±(jiàn)添加函數(shù):
function addMapCo≤→©♦ntrol(){
&n≤&bsp; //向地(dì)圖中添加縮放(fàng)控件(j≈ ±✔iàn)
var ctrl_ קεnav = new BMap.NavigationControl↑♠±↓({anchor:BMAP_ANCHOR_TOP_LEFT,type:BM"↕×AP_NAVIGATION_CONTROL_L≈'ARGE});
map.ad&₹÷≤dControl(ctrl_nav);
 "₹§; //向地(dì)圖中添加∑₹縮略圖控件(jiàn)
var ctrl_o®♦ve = new BMap.OverviewMapControl({anch±₹±'or:BMAP_ANCHOR_BOTTO€₹M_RIGHT,isOpen:1});
map.addContro₩±δl(ctrl_ove);
 ∏₹β; //向地(dì)圖中添加比例尺控件(™¶λjiàn)
vβ♠¶ar ctrl_sca = new BMap.ScaleControl({a'$nchor:BMAP_ANCHOR_BOTTOM_LEFT});
map.add&×₩★Control(ctrl_sca);
}
//标注點數(shù)← ₩組
var markerArδ&♣✘r = [{title:"Wit-Color",¥αcontent:"Address:No. 1959&am÷σp;nbsp;Shangsu •§Road, Qingcun&am p;nbsp;Town, Fengxian$¶α↓ District,&nbs✘₩∑p;Shanghai, Chi'¥na.201414<br/>Tel:+86-21-54881↓↔966, Mob.:+86-18017197700≈α∑",point:"121.564774|30.923248",isOp¥±en:0,icon:{w:21,h:21,l✔€:0,t:0,x:6,lb:5}}
&∑' ];
//創建marker
functio≤"βn addMarker(){
&σ•♦nbsp; for(var i=0;i<markerArβ& r.length;i++){
&nb$♠£sp; & λπnbsp; var json = markerArr[i];
&n♦bsp;  ©♥↑; var p0 = json.point.split("|")[0];
₩→σ &nbδ★π≠sp; var p1 = json.point.split("|")[α♦₹₩1];
 ≠π'; &n<•βbsp; var point = new BMap.Point(↑<p0,p1);
&♠★nbsp; &nbε↓≠sp; var iconImg = createIcon(json.ico®∏n);
&← &nb®£sp; var m"™λarker = new BMap.Marker(point,{icon§ε:iconImg});
 ♠≥; &'≤♦nbsp; var iw = createInfo☆"Window(i);
&★₽  σ≈≤; var label = new BMap.Label(Ω δjson.title,{"offset":new BMap.Size(json€™Ω.icon.lb-json.icon.x+10,-20)});
&nbsδ ™p; £ marker.setLabel(label);
&n ✘δbsp; ∞↑↓ map.addOv≠→✘εerlay(marker);
&nbsλ ←≠p; &¶✔nbsp; label.←setStyle({
&>♣nbsp; &γ nbsp; &ε &nbε≈>γsp; &nb↕↕© sp; borderColor:"#808080",
 ∏±±; &≠ nbsp; &n ★↔÷bsp; &nbs∏α♥•p; &¶£₩nbsp; color:"#333",
 •Ω ; &n§♠"bsp; &nb₩φ≈∑sp;  ≈; cursor:"pointe₹ r"
&nb∞ sp; &nbs"→p; });
 <βγ✔; &nbs≥ <p;
&n↕φbsp; &✔©nbsp; (function(){
♦ &nbsσ♣p; σ£≈> var ind £↑ex = i;
&n™•<δbsp;  £± ;  ≥↓>; var _iw = createInfoWαα∑indow(i);
  π; &n bsp; $α var _marker = marker;
&nbs ₩®♣p;  ←↑φ; ♣≠α_marker.addEventListener("click",fu©> ↔nction(){
 ♥π"•; &nbs Ω♥∞p; &nbs ∏p; this.op✔✔∑₩enInfoWindow(_iw);
&σ∞nbsp; &nbs ↔p; });
&nbs₽ק§p; &nbs®↕→p; &₽ ₽nbsp; _iw.addEventListen¥"€er("open",function(){
&nb'₩αsp; &nb≥↑♥sp; &n®₩✔bsp; &←××nbsp; _marker.getLabel().hide();
&π>↕∏nbsp;  ♣✘←; &×&£nbsp; })
&nbsλ∑p; ✔★ ε★δ _iw.addEventListener("clo>≈↑se",function(){
&n≈™↕bsp;  ←≠♣; ⶧ &nΩ™bsp; _marker.getLabel().show();
&nbsγ←↑p; ♦§ &n₹®£₽bsp; })
&¥∞nbsp; &nb✘↕₹ sp; &nbs φ↓p; label.addEventListene →r("click",function(){
&n↑♣∏bsp; &&≠¥nbsp;  ¥δ≈; _marker.openInfoWφ∏φindow(_iw);
&∞≥★δnbsp; &nλ§πβbsp;  α∏αφ; })
&©Ωnbsp; &n✘'§☆bsp; if(!!json.isOpen<'♦){
 >∞®; &nb≈ ♠sp; &nσπ♦♣bsp; label.hide();
&nbα¶&↕sp; &nbs↕¶p; &εεnbsp; _marker.openInfoWindα☆•ow(_iw);
&•←←↓nbsp; &nb☆sp;  β₹₹™; }
&nbβ×∞±sp; &nbs₹₽¶p; })()
&✔σnbsp; }
}
//創建InfoWindow
function createI∑¥nfoWindow(i){
&nbs₽πp; var j₹₹≤son = markerArr[i];
&n× bsp; var iw = new BMap.InfoW→♥ indow("<b class='iw_p<£§÷oi_title' title='" + j↕∞¥son.title + "'>" + j±♠<son.title + "</b><diδ←v class='iw_poi_content'>"+json.contλ→ent+"</div>");
 £®♣×; return iw¥®;
}
//創建一(yī)個(gè)I¥♠con
function create•♠®αIcon(json){
 ₹✔; var ico ♥n = new BMap.Icon("http://a↔βγpp.baidu.com/map/images/us_mk_icon•".png", new BMap.Size(js☆→on.w,json.h),{imageOffset: new BMa₩↔♥€p.Size(-json.l,-json.t),infoWindowOffs≈£>et:new BMap.Size(json.lb+5,1),offset:↔'δnew BMap.Size(json.x,"&λ→json.h)})
 ♦γ♦✘; return icon;
}
initMap();/↑÷α/創建和(hé)初始化(huà)地(dì)圖
</script>
</html>