.![]() |
Shanghai Wit-Color Digital •ε€Science & Technology Cσ&o., Ltd. Address: No.1959 Shan₽∞δgsu Road, Qingcun Town, |
Int'l Sales Department | Int'l Aftersales Service&n×☆¶bsp;Department | |||
Mr. Leo Lee / Gener≤±≤§al Director of φ÷×;ISD | Mr. Eric / Gen✘ ♠ eral Director of IA ≥₩SD | |||
Mobile/Wechat/Whatsapp:0086-18017197700 |
Mobile/Wechat/Whatsapp: 86-18017197711 | |||
Tel: 86-21-5488λ↔ 1966-8700 | Tel: 86-21-54881966-8711↑↕ | |||
E-mail: marketing@wit-color.c∞ ✘n | E-mail:support@wit-color.cn | |||
QQ: 2880677211 (QQ ★→←;Mail Available) |
<!DOCTYPE html PUBLIC "-//W3C//↓±±ΩDTD XHTML 1.0 Transitional//EN" "h ≥§σttp://www.w3.org/TR/xhtml1/DTD/xhtml&≠1-transitional.dtd">
<html xmlns="http:/≤×/www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Conte₹$λnt-Type" content="text/html; ✘₩charset=gb2312" />
<meta name="keywor∑&" ds" content="百度地(dì)圖,百度地(dì)圖API,百度地(≤<₩£dì)圖自(zì)定義工(gōng)具,百§♥♠度地(dì)圖所見(jiàn)即所得(de)工(gōng)具β" />
<meta name="description" content="百度☆≠地(dì)圖API自(zì)定義地(dì)圖,幫助用(γ≤₽yòng)戶在可(kě)視(shì)化(huà)操作(z$±÷uò)下(xià)生(shēng)成百度地(dì)圖₹←☆✔" />
<title>百度地(dì)圖API自(zì)定義地(dì)圖&lδ¶σt;/title>
<!--引用(yòng)百度地(dì)圖API--&g®↕λt;
<style type="text/css">
html,body{margin:0;δ∞padding:0;}
.iw_poi_title {c§♠↑olor:#CC5522;font-si≥÷•→ze:14px;font-weight:bold;overflow:hidd¥♥en;padding-right:13px;white-space:≠βnowrap}
.iw_♦✔poi_content {font:12px ariσ φ∑al,sans-serif;overflow:vφ↓isible;padding-top:4px™&π;white-space:-moz-pre-wrap;word-wr"¥ap:break-word}
</style>
<script type="text/javascrip¶✘δt" src="http://api.map.baidu.com$λ/api?key=&v=1.1&service↑✘s=true"></script&α★♥gt;
</head>
<body>
<!--百度地(dì)圖容器∏™↔(qì)-->
<div style="width:697px;hei§↓©™ght:550px;border:#ccc s>♠πolid 1px;" id="dituContent">≤✔</div>
</body>
<script type="text/javascript">☆∞β;
//創建®©和(hé)初始化(huà)地(dì)圖函數(sh$→♥ù):
function ×Ω ≤initMap(){
δ©± createMap();//創建地(dì)←↑δ圖
 ±¶$♥; setMapEvent();//設&©§≈置地(dì)圖事(shì)件(jiàn)
 &'♥; ad↓✔ γdMapControl();//向地(dì)'♠Ω∞圖添加控件(jiàn)
&∏✔ ↑nbsp; addMarker();/÷∑£/向地(dì)圖中添加marker
}
//★φ創建地(dì)圖函數(shù):
function c≤ε'reateMap(){
>≈★¥ var map = new BMap.Map("di∏∞βtuContent");//在百度地(d£₹ì)圖容器(qì)中創建一(yī)個(gè)地(dì)圖
&nb₽₹sp; var point = new>↔ BMap.Point(121.565057,×>30.923209);//定義一(yī)個(gè)中心點坐(zuò)标
&nb≤♦sp; map.centerA '∞ ndZoom(point,18);//設定地(dì)圖>®的(de)中心點和(hé)坐(zuò)标并将地(dì)∏≠圖顯示在地(dì)圖容器(qì)中
&nbΩ£sp; window.map = map;//将map變量♣→&存儲在全局
}
//地(dì)圖事(sα÷αhì)件(jiàn)設置函數(shù):
functio±∑®n setMapEvent(){
&n∞♥↔bsp; map.enableDragging();//啓用(→₽£yòng)地(dì)圖拖拽事(shì)件(jiàn),默認啓用(↓γyòng)(可(kě)不(bù)寫)
&nbs p; map.enableScrollWheelZoom()Ω←€↑;//啓用(yòng)地(dì)圖滾輪放(fàng)大(dà)縮小 ε∏(xiǎo)
&n¶✔¶₽bsp; map.enableDoubleClickZoom() §↑;//啓用(yòng)鼠标雙擊放(fàng)' 大(dà),默認啓用(yòng)(可(kěΩ&®€)不(bù)寫)
&>γnbsp; map.en♦<¥ableKeyboard();//啓用(yòng)鍵盤上(shàng)下 ↕≠≠(xià)左右鍵移動地(dì)圖
}
//地(dì)圖控件(jià&↔¥δn)添加函數(shù):
funct→ε₹ion addMapControl(){
 ✘×♠σ; //向地(dì)圖中添加縮放¥(fàng)控件(jiàn)
var ctrl_nav = neφ₩δw BMap.NavigationControl({ancho∞α₽±r:BMAP_ANCHOR_TOP_LE✔ FT,type:BMAP_NAVIGATION_CONTROL_LARGE})₹ ♣';
map.addCo>≥"✘ntrol(ctrl_nav);
&nbsλΩ∑p; //向地(dì)圖中添加縮略φ↓>✔圖控件(jiàn)
va£φr ctrl_ove = new BMap.OverviewMapCon≥ trol({anchor:BMAP_ANCHOR♥♥Ω_BOTTOM_RIGHT,isOpen:1});
map.addControl(ctrl←α<_ove);
&nb&✘sp; //向地(dì)圖中添加比例尺控件(jiàn)
var ctr≈™€l_sca = new BMap.ScaleContr<ol({anchor:BMAP_ANCHO ÷≥↔R_BOTTOM_LEFT});
maπ&✔p.addControl(ctrl_sca);
}
//标注點數(shù)組
v¶×ar markerArr = [{titl∏>εe:"Wit-Color",content:"Address:No.'>↑← 1959 Shangsu&am→¥↓≈p;nbsp;Road, Qingcun&a♦αmp;nbsp;Town, Fengxian&nb÷εsp;District, Shangh ✘ai, China.201414&l£♣t;br/>Tel:+86-21-54881966,&a∏₹mp;nbsp;Mob.:+86-180171σ♣σ<97700",point:"121.564774|30.923248",is Open:0,icon:{w:21,h:21,l:0,t:0,x:6,lb:5∏××↕}}
&n•®bsp; ];
//創建mar≥ ↕ker
funct®₹δion addMarker(){
&<✘☆nbsp; for(var i=0;i<mark≠ erArr.length;i++){
☆Ω &nbσ™₽sp; var json = markerArr[i];
&nb₽↑€sp;  ≥©∑ ; var p0 = json.poin∏¶t.split("|")[0];
&π✔nbsp; var p1¶$ = json.point.split("|")[1];
 ≥♦; &±≈ var point = new ∏γBMap.Point(p0,p1);
β& var iconImg = create≤→♣Icon(json.icon);
&n' bsp; ∏¶±∞ var marker = new BMap.M✔arker(point,{icon:iconImg});
&n≥←bsp; &n∏Ωbsp;var iw = createInfoWindow(i);
&nb★♣sp; £€ var label = new BMap→£ ♣.Label(json.title,{"offset":ne&∏Ωw BMap.Size(json.icon.lb-jso₽§↕n.icon.x+10,-20)});
&nbs©¥€p; &n ¥επbsp;marker.setLabel(label);
&n₽•≠♦bsp; $Ω>< map.addO≈γ×verlay(marker);
&n σbsp; &nbs♥♦p; &nbs™✘ βp; label.setStyle({
&nb± Ωsp; &&πnbsp; &nb'γsp;  εδ; &nb→π♠sp; borderColor:"#808080",
&n&♠Ωbsp; &φ₽ nbsp; &n γbsp; &nbs &p; color:"#333",
&nα bsp; &£™÷"nbsp; &nbs↔≤p; '§→ &nbεΩ≥sp; c≥<§≤ursor:"pointer"
✘α });
&nb®φφ₹sp;
&n λ♠bsp; &nb""sp;(function(){
&×Ωβnbsp; &nσ®€∞bsp; var index = i;
&nb→←≥sp; &nbs<λp; var _iw = createInfoW≤≈indow(i);
&∏→♠×nbsp; &nb☆≈sp; var _marker = marker;
&§&γ"nbsp; &n✘嶀bsp; _marker.addEveδ<←ntListener("click",function(){
&nb£φ&♦sp; &n₹©bsp; &n®¥∏bsp; this.ope✘λεnInfoWindow(_iw);
&nbs♦ σp; &n↕$σbsp; });
&n← εbsp; ↔←₽ _iw.>♦addEventListener("open",f §π"unction(){
&nΩπ•bsp; &nb<₽♥≤sp; ♦♦₹δ _marker.getLabel().hide();
&≤ £nbsp; &nbsε≈₩p; }<<)
 £♥; ≥↓•± _iw.add♦←EventListener("close",functioε∞×n(){
&nbs✔₩βp; &nb♣π≠sp; &nbsδ♣<p; _marker.getLab ♦Ω"el().show();
&nb≠sp; &♣δ ≠nbsp; })
&n♠®∏"bsp; &n ↑bsp; label.a♠ €ddEventListener("click",functio↔≥∞∏n(){
π☆ &nbφ♦sp; &nbs★₩p; _marke'↔r.openInfoWindow(_iw);
&nbsφσΩp; &nb<Ω sp; })α☆
&n∑♠bsp; &nb• sp; if(!!json.isOpe∑∞n){
 >≈£; &nbs♥♥§ p; ¶↑δ label.hide();
 <λ∞™; ∞₽↓ ∑<♥§ _marker.openInfoWindow(_iw ∏¥");
λ© &nbs∞÷p; }
&nb≤®↔sp; })()
&nbπ×®₹sp; }
}
//創建≤♠InfoWindow
function♠₽ createInfoWindow(i){
&nb ₹sp; var json = markerArr[i™©];
&nbs<♥$p; var iw = new BM≥←≈ap.InfoWindow("<b cla ✘Ωss='iw_poi_title' title='" + json.tit←☆ le + "'>" + json.title + "&l©☆βt;/b><div class㱧='iw_poi_content'>•λ;"+json.content+"</div>");
&n≥↑bsp; return iw;
}
//創建一(yī)個(gè)☆♣→Icon
function≠β≈ createIcon(json){
π£ var icon = new ®BMap.Icon("http://app.baidu.com/map/i×≈mages/us_mk_icon.png", new BMap.Size(js₽§on.w,json.h),{imageOffset: new BMap.Si>♥✘ze(-json.l,-json.t),infoWindo$•♥©wOffset:new BMap.Size(json.lb+5,1),off€♠set:new BMap.Size(json.x,jso>€∞n.h)})
&₹nbsp; return icon;
}
initMap();//創建和(hé♥×α)初始化(huà)地(dì)圖
</script>
</html>
<html xmlns="http:/≤×/www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Conte₹$λnt-Type" content="text/html; ✘₩charset=gb2312" />
<meta name="keywor∑&" ds" content="百度地(dì)圖,百度地(dì)圖API,百度地(≤<₩£dì)圖自(zì)定義工(gōng)具,百§♥♠度地(dì)圖所見(jiàn)即所得(de)工(gōng)具β" />
<meta name="description" content="百度☆≠地(dì)圖API自(zì)定義地(dì)圖,幫助用(γ≤₽yòng)戶在可(kě)視(shì)化(huà)操作(z$±÷uò)下(xià)生(shēng)成百度地(dì)圖₹←☆✔" />
<title>百度地(dì)圖API自(zì)定義地(dì)圖&lδ¶σt;/title>
<!--引用(yòng)百度地(dì)圖API--&g®↕λt;
<style type="text/css">
html,body{margin:0;δ∞padding:0;}
.iw_poi_title {c§♠↑olor:#CC5522;font-si≥÷•→ze:14px;font-weight:bold;overflow:hidd¥♥en;padding-right:13px;white-space:≠βnowrap}
.iw_♦✔poi_content {font:12px ariσ φ∑al,sans-serif;overflow:vφ↓isible;padding-top:4px™&π;white-space:-moz-pre-wrap;word-wr"¥ap:break-word}
</style>
<script type="text/javascrip¶✘δt" src="http://api.map.baidu.com$λ/api?key=&v=1.1&service↑✘s=true"></script&α★♥gt;
</head>
<body>
<!--百度地(dì)圖容器∏™↔(qì)-->
<div style="width:697px;hei§↓©™ght:550px;border:#ccc s>♠πolid 1px;" id="dituContent">≤✔</div>
</body>
<script type="text/javascript">☆∞β;
//創建®©和(hé)初始化(huà)地(dì)圖函數(sh$→♥ù):
function ×Ω ≤initMap(){
δ©± createMap();//創建地(dì)←↑δ圖
 ±¶$♥; setMapEvent();//設&©§≈置地(dì)圖事(shì)件(jiàn)
 &'♥; ad↓✔ γdMapControl();//向地(dì)'♠Ω∞圖添加控件(jiàn)
&∏✔ ↑nbsp; addMarker();/÷∑£/向地(dì)圖中添加marker
}
//★φ創建地(dì)圖函數(shù):
function c≤ε'reateMap(){
>≈★¥ var map = new BMap.Map("di∏∞βtuContent");//在百度地(d£₹ì)圖容器(qì)中創建一(yī)個(gè)地(dì)圖
&nb₽₹sp; var point = new>↔ BMap.Point(121.565057,×>30.923209);//定義一(yī)個(gè)中心點坐(zuò)标
&nb≤♦sp; map.centerA '∞ ndZoom(point,18);//設定地(dì)圖>®的(de)中心點和(hé)坐(zuò)标并将地(dì)∏≠圖顯示在地(dì)圖容器(qì)中
&nbΩ£sp; window.map = map;//将map變量♣→&存儲在全局
}
//地(dì)圖事(sα÷αhì)件(jiàn)設置函數(shù):
functio±∑®n setMapEvent(){
&n∞♥↔bsp; map.enableDragging();//啓用(→₽£yòng)地(dì)圖拖拽事(shì)件(jiàn),默認啓用(↓γyòng)(可(kě)不(bù)寫)
&nbs p; map.enableScrollWheelZoom()Ω←€↑;//啓用(yòng)地(dì)圖滾輪放(fàng)大(dà)縮小 ε∏(xiǎo)
&n¶✔¶₽bsp; map.enableDoubleClickZoom() §↑;//啓用(yòng)鼠标雙擊放(fàng)' 大(dà),默認啓用(yòng)(可(kěΩ&®€)不(bù)寫)
&>γnbsp; map.en♦<¥ableKeyboard();//啓用(yòng)鍵盤上(shàng)下 ↕≠≠(xià)左右鍵移動地(dì)圖
}
//地(dì)圖控件(jià&↔¥δn)添加函數(shù):
funct→ε₹ion addMapControl(){
 ✘×♠σ; //向地(dì)圖中添加縮放¥(fàng)控件(jiàn)
var ctrl_nav = neφ₩δw BMap.NavigationControl({ancho∞α₽±r:BMAP_ANCHOR_TOP_LE✔ FT,type:BMAP_NAVIGATION_CONTROL_LARGE})₹ ♣';
map.addCo>≥"✘ntrol(ctrl_nav);
&nbsλΩ∑p; //向地(dì)圖中添加縮略φ↓>✔圖控件(jiàn)
va£φr ctrl_ove = new BMap.OverviewMapCon≥ trol({anchor:BMAP_ANCHOR♥♥Ω_BOTTOM_RIGHT,isOpen:1});
map.addControl(ctrl←α<_ove);
&nb&✘sp; //向地(dì)圖中添加比例尺控件(jiàn)
var ctr≈™€l_sca = new BMap.ScaleContr<ol({anchor:BMAP_ANCHO ÷≥↔R_BOTTOM_LEFT});
maπ&✔p.addControl(ctrl_sca);
}
//标注點數(shù)組
v¶×ar markerArr = [{titl∏>εe:"Wit-Color",content:"Address:No.'>↑← 1959 Shangsu&am→¥↓≈p;nbsp;Road, Qingcun&a♦αmp;nbsp;Town, Fengxian&nb÷εsp;District, Shangh ✘ai, China.201414&l£♣t;br/>Tel:+86-21-54881966,&a∏₹mp;nbsp;Mob.:+86-180171σ♣σ<97700",point:"121.564774|30.923248",is Open:0,icon:{w:21,h:21,l:0,t:0,x:6,lb:5∏××↕}}
&n•®bsp; ];
//創建mar≥ ↕ker
funct®₹δion addMarker(){
&<✘☆nbsp; for(var i=0;i<mark≠ erArr.length;i++){
☆Ω &nbσ™₽sp; var json = markerArr[i];
&nb₽↑€sp;  ≥©∑ ; var p0 = json.poin∏¶t.split("|")[0];
&π✔nbsp; var p1¶$ = json.point.split("|")[1];
 ≥♦; &±≈ var point = new ∏γBMap.Point(p0,p1);
β& var iconImg = create≤→♣Icon(json.icon);
&n' bsp; ∏¶±∞ var marker = new BMap.M✔arker(point,{icon:iconImg});
&n≥←bsp; &n∏Ωbsp;var iw = createInfoWindow(i);
&nb★♣sp; £€ var label = new BMap→£ ♣.Label(json.title,{"offset":ne&∏Ωw BMap.Size(json.icon.lb-jso₽§↕n.icon.x+10,-20)});
&nbs©¥€p; &n ¥επbsp;marker.setLabel(label);
&n₽•≠♦bsp; $Ω>< map.addO≈γ×verlay(marker);
&n σbsp; &nbs♥♦p; &nbs™✘ βp; label.setStyle({
&nb± Ωsp; &&πnbsp; &nb'γsp;  εδ; &nb→π♠sp; borderColor:"#808080",
&n&♠Ωbsp; &φ₽ nbsp; &n γbsp; &nbs &p; color:"#333",
&nα bsp; &£™÷"nbsp; &nbs↔≤p; '§→ &nbεΩ≥sp; c≥<§≤ursor:"pointer"
✘α });
&nb®φφ₹sp;
&n λ♠bsp; &nb""sp;(function(){
&×Ωβnbsp; &nσ®€∞bsp; var index = i;
&nb→←≥sp; &nbs<λp; var _iw = createInfoW≤≈indow(i);
&∏→♠×nbsp; &nb☆≈sp; var _marker = marker;
&§&γ"nbsp; &n✘嶀bsp; _marker.addEveδ<←ntListener("click",function(){
&nb£φ&♦sp; &n₹©bsp; &n®¥∏bsp; this.ope✘λεnInfoWindow(_iw);
&nbs♦ σp; &n↕$σbsp; });
&n← εbsp; ↔←₽ _iw.>♦addEventListener("open",f §π"unction(){
&nΩπ•bsp; &nb<₽♥≤sp; ♦♦₹δ _marker.getLabel().hide();
&≤ £nbsp; &nbsε≈₩p; }<<)
 £♥; ≥↓•± _iw.add♦←EventListener("close",functioε∞×n(){
&nbs✔₩βp; &nb♣π≠sp; &nbsδ♣<p; _marker.getLab ♦Ω"el().show();
&nb≠sp; &♣δ ≠nbsp; })
&n♠®∏"bsp; &n ↑bsp; label.a♠ €ddEventListener("click",functio↔≥∞∏n(){
π☆ &nbφ♦sp; &nbs★₩p; _marke'↔r.openInfoWindow(_iw);
&nbsφσΩp; &nb<Ω sp; })α☆
&n∑♠bsp; &nb• sp; if(!!json.isOpe∑∞n){
 >≈£; &nbs♥♥§ p; ¶↑δ label.hide();
 <λ∞™; ∞₽↓ ∑<♥§ _marker.openInfoWindow(_iw ∏¥");
λ© &nbs∞÷p; }
&nb≤®↔sp; })()
&nbπ×®₹sp; }
}
//創建≤♠InfoWindow
function♠₽ createInfoWindow(i){
&nb ₹sp; var json = markerArr[i™©];
&nbs<♥$p; var iw = new BM≥←≈ap.InfoWindow("<b cla ✘Ωss='iw_poi_title' title='" + json.tit←☆ le + "'>" + json.title + "&l©☆βt;/b><div class㱧='iw_poi_content'>•λ;"+json.content+"</div>");
&n≥↑bsp; return iw;
}
//創建一(yī)個(gè)☆♣→Icon
function≠β≈ createIcon(json){
π£ var icon = new ®BMap.Icon("http://app.baidu.com/map/i×≈mages/us_mk_icon.png", new BMap.Size(js₽§on.w,json.h),{imageOffset: new BMap.Si>♥✘ze(-json.l,-json.t),infoWindo$•♥©wOffset:new BMap.Size(json.lb+5,1),off€♠set:new BMap.Size(json.x,jso>€∞n.h)})
&₹nbsp; return icon;
}
initMap();//創建和(hé♥×α)初始化(huà)地(dì)圖
</script>
</html>