.![]() |
Shanghai Wit-Color Digita♣♦₹αl Science & Technology Co., Ltd. Address: No.1959 Shangs♥γ§σu Road, Qingcun Town, |
Int'l Sales Department♥→≥ | Int'l Aftersales Service ™♦β≈;Department | |||
Mr. Leo Lee / Gene✘βral Director of&n&₽bsp;ISD | Mr. Eric / Geε♣β↑neral Director of I♦≤ •ASD | |||
Mobile: 0086-1801719↕ 7700 | Mobile: 86-18017197711 | |||
Tel: 86-21-54881966-870≤₽0 | Tel: 86-21-54881966-×λ8711 | |||
Fax:86-21-54889946 | Fax: 86-21-54881617 | |||
E-mail: marketing@wit-cε olor.cn | E-mail:support@wit-color.cn | |||
QQ: 2880677231 £✘(QQ Mail A♦↑γ&vailable) | QQ: 2880677211 &nbs₹γδ♦p;(QQ Mail Available) |
<!DOCTYPE html PUBLIC "-//W3C×↔↔//DTD XHTML 1.0 Transit•ε←ional//EN" "http://www.w3.org/TR/xh÷"'σtml1/DTD/xhtml1-transitional.dtd"§≥§λ>
<html xmlns="http://www.w3.org<Ω$/1999/xhtml">
<head>
<meta http-equiv="Co'∏ntent-Type" content="text/html; char★←•set=gb2312" />
<meta name="keywords" content="百度₹Ωσ∞地(dì)圖,百度地(dì)圖API,百度地(dì)圖自(z✔βδì)定義工(gōng)具,百度地(dì)圖所見(jià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ì)圖API--π≥>
<style type="text/css">
html,body{mar♣φεgin:0;padding:0;}
.iw_poi_title {color¶¶'™:#CC5522;font-size:14px;font-₹↑£ weight:bold;overflow:hidden;padding-rig♣₩¶&ht:13px;white-space:nowrπ<'Ωap}
.iw_poi_contentπ♣₽ {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.b ♠↔$aidu.com/api?key=&v=1.α↓<1&services=true"></script>∑β§
</head>
<body>
<!--百度地(dì)圖容器(qì)-->
<div style="width:697px;he±©↓♦ight:550px;border:#ccc solid 1px;∞♥≤" id="dituContent">→β</div>
</body>
<script type="text/ <✘javascript">
//創"✘建和(hé)初始化(huà)地(dì)圖函數(shù):
function ini"ε∞tMap(){
&nbπ∞♠sp;  δ£ ≈; createMap();//創建地(dì)圖
&nbΩ'sp; setMapEvent();÷←π✘//設置地(dì)圖事(shì)件(jiàn)
&nb♠ε≥sp; addMapControl();//向地(dì)圖添加控件(jiàn)×£&
&nb'φsp; addMarker()₽€;//向地(dì)圖中添加marker
}
//創建地(dì)圖函數(α↓&≈shù):
function♣§ createMap(){
&<& ₹nbsp; var map = new BMaγ™±αp.Map("dituContent");//在百度地(dì)圖容器(qì)中 ₽≈"創建一(yī)個(gè)地(dì)圖
÷£Ω var point =≤≠ new BMap.Point(121.565057"",30.923209);//定義一(yī)個(gè)中心點坐λ&(zuò)标
♣≈ map.centerA≠ ndZoom(point,18);//設 ↔✔定地(dì)圖的(de)中心點和(hé)坐(zuò←λσ×)标并将地(dì)圖顯示在地(dì)圖容器(q™Ω↕ì)中
&nb•☆♦sp; wi✘$ndow.map = map;//将ma✘← p變量存儲在全局
}
//地(dì)圖事(shìπ₹)件(jiàn)設置函數(shù):
functi∑★±>on setMapEvent(){
≤₩✔σ map.enableDraggi&$ng();//啓用(yòng)地(dì)圖拖拽事(shì)件(£∑♣jiàn),默認啓用(yòng)(可(kě)不(bù)寫)
&≥↕∑nbsp; map.enabl₽eScrollWheelZoom();//啓用(yòng)地(dì)圖滾輪放(↑>fàng)大(dà)縮小(xiǎo)
&nbsφ φ♥p; map.enableDoubleClicβ₽↕kZoom();//啓用(yòng)鼠标€↑雙擊放(fàng)大(dà),默認啓用(yòng)(可(¥€kě)不(bù)寫)
&n✘¥≥bsp; ©™✘≥ map.enableKeyboard();¥✔//啓用(yòng)鍵盤上(shàng)下(xià)左右鍵移動地(d§β♥ì)圖
}
//地≤σβλ(dì)圖控件(jiàn)添加函數(shù):
function addMapContr$→↓®ol(){
 α¶↕£; //向地(dì)圖中添加縮放(fàng)控件∑Ω✘×(jiàn)
var ctrl_nav = new↑¥↔♣ BMap.NavigationControl({anch¥&$©or:BMAP_ANCHOR_TOP_LEFT,ty☆←pe:BMAP_NAVIGATION_CONTROL_LARGE});
map.addContrδε>×ol(ctrl_nav);
α& //向地(dì)圖中添加縮略圖控件↔♠(jiàn)
var ctrl_ove = new $♣BMap.OverviewMapControl({anchor:BMAP_AN→•™↔CHOR_BOTTOM_RIGHT,isOpen:1}£');
map.ad ↕¶dControl(ctrl_ove);
&nbs≤←p; //向地(dì)圖中添加比例☆¥₹尺控件(jiàn)
var ctrl_sσφca = new BMap.ScaleControl({anch§∏☆λor:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(c→®♣↓trl_sca);
}
//标注點數(shù)組
varα×£× markerArr = [{title:" €♦Wit-Color",content:"Addrγ©&☆ess:No. 1959 S∞∏hangsu Road, Qingcun♥δ✘ Town, Fengxia∞♣n District, Shδ anghai, China₩∞.201414<br/>Tel:+86-21-54881966,&β×↑∞amp;nbsp;Mob.:+86-18017197700",poin&♣γδt:"121.564774|30.923248",isOpe™•n:0,icon:{w:21,h:21,↕÷πεl:0,t:0,x:6,lb:5}}
¥♠¶ ];
//創建marker
function £↓∞addMarker(){
€ fo£←∞ r(var i=0;i<markerA↑"rr.length;i++){
&πγ σnbsp; var j←son = markerArr[i];
&nb∞ sp; ÷÷♣✔ var p0 = json.₹>₽point.split("|")[0];
&nb ↕sp; &nbΩ∞σsp; var p1 = json.point.s¥φ₽©plit("|")[1];
&₹>nbsp; &nb λ•®sp; var point = ne ±↕w BMap.Point(p0,p1);
&★>★nbsp; &nbs &₹πp; var iconImg = createIcon(json.→∞icon);
&n♠↔™÷bsp; &nbs<★¥p; var m"←§arker = new BMap.Marker(≥& point,{icon:iconImg}$ש>);
&↕∑nbsp; §$≠ var iw = creatφ£∞&eInfoWindow(i);
&nb∏♠λsp; var label =∑'≥∏ new BMap.Label(json.title→ ,{"offset":new BMap.©¥δSize(json.icon.lb-json.iε•★con.x+10,-20)});
 α↑↑&; φ≈®marker.setLabel(label);≥®≠
&nφ©✔πbsp; &nbs p; map.addOverlay(markeφ₩r);
 ≥β; &n♠$∞©bsp; label.setStyle({€☆♦
δ &n λbsp; ¥ &nbs✔≤&®p; &¥♦₩®nbsp; borderColo≤≥λ₽r:"#808080",
&nb <↔sp; &'♠nbsp; &n™≈bsp; ≈∑↕ &₽ nbsp; color:"#333",
•↑₽∑ &nb♦®•♦sp; &nb λ☆>sp; &™✔✘nbsp; &nb₽♣Ωsp; cursor:"↕Ωpointer"
&♠∞×↓nbsp; &nbs §₹p; });
φ≠
&nbs®Ω≤p;  ¶"♦→;(function(){
&nb₽€✘↑sp; &nb ÷sp;var index = i;
&nb✘γ≤©sp; &nbs®₹p; var _iw $δ = createInfoWindow(i)®₹₩;
&nb÷ ♥∏sp;  ✘ ≤♦; var _marker = marker;
&↑↑nbsp; &>✘nbsp; _marke$£©r.addEventListener("click",func∑≤§tion(){
&n♦★±≥bsp; ¥× &nbs←€₽™p; this.opλ$£εenInfoWindow(_iw);
&nbφ✔sp; &nbs®£p; ☆¥ });
 λ∑; ₩ _iw.addEventList•≤™γener("open",function(){
♠γ≈ &n≈€€bsp; _marker↕.getLabel().hide();
&n ↕&γbsp; &nb♦§sp; })
&nφ≤bsp; &nbγ® sp; _iw.addEveβ★₹ntListener("close",fun£®ction(){
&nbs"βp; &★>€nbsp;  →δ; _marker.getL↑∑↓abel().show();
&n€¶bsp;  × $; })
& ∞nbsp; &n&₹βbsp;label.addEventListener("click",fun∏₽ction(){
&nbsΩ₹£δp; &n≥γ bsp; &n∏♦↓₹bsp; _marker.openInfoWindow(_iw±§β₹);
&n→ ♠✘bsp; &☆Ωnbsp; &nbσ♠≥sp; })
≠¥©↔ &n'≥≠bsp; if(!!json.isO¶×€↓pen){
&nbs£≠p; &nbs∏♣©p; &nbs>∑↑ p; label.hide()♣★Ω;
&nbsΩ£σλp; &nbsφ↕♠φp; &♦ε™nbsp;_marker.openInf™∑§₩oWindow(_iw);
&↑✘≈nbsp; &nbsα ♣∞p; }
λ&₩ &n®βbsp;})()
™σ }
}
//創建>₩φ₩InfoWindow
func×¥tion createInfoWindow(i){§
&nbs§φ₩p; var json = markerArr[i];•α
&nb ↔σπsp; ∞α≥≥var iw = new BMap.InfoWindow("<b clλ✘ass='iw_poi_title' title='" + js♥♣©on.title + "'>" +∏✘₹↔ json.title + "</b><div class=÷®>≈'iw_poi_content'>"+json★§.content+"</div>");
&nb↓sp; return iw;
}
//創建一(yī)個(gè≤£♣)Icon
function ← createIcon(json){
&nbλ±™sp; var icon = new BMap'∏≈<.Icon("http://app.baidu.com/map✔γ¥/images/us_mk_icon.png", new BMap.±€≈Size(json.w,json.h),{imageOffset: new BΩ₩Map.Size(-json.l,-json.t),infoWiαδndowOffset:new BMap.Size(json.lb+5,1)γ,offset:new BMap.Size(json.x,json.h)})≤★®
&nbs→Ω®↕p; return icon;
}
initM©₩∑ap();//創建和(hé)初始化(huà)地÷↕→∏(dì)圖
</script>
</html>
<html xmlns="http://www.w3.org<Ω$/1999/xhtml">
<head>
<meta http-equiv="Co'∏ntent-Type" content="text/html; char★←•set=gb2312" />
<meta name="keywords" content="百度₹Ωσ∞地(dì)圖,百度地(dì)圖API,百度地(dì)圖自(z✔βδì)定義工(gōng)具,百度地(dì)圖所見(jià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ì)圖API--π≥>
<style type="text/css">
html,body{mar♣φεgin:0;padding:0;}
.iw_poi_title {color¶¶'™:#CC5522;font-size:14px;font-₹↑£ weight:bold;overflow:hidden;padding-rig♣₩¶&ht:13px;white-space:nowrπ<'Ωap}
.iw_poi_contentπ♣₽ {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.b ♠↔$aidu.com/api?key=&v=1.α↓<1&services=true"></script>∑β§
</head>
<body>
<!--百度地(dì)圖容器(qì)-->
<div style="width:697px;he±©↓♦ight:550px;border:#ccc solid 1px;∞♥≤" id="dituContent">→β</div>
</body>
<script type="text/ <✘javascript">
//創"✘建和(hé)初始化(huà)地(dì)圖函數(shù):
function ini"ε∞tMap(){
&nbπ∞♠sp;  δ£ ≈; createMap();//創建地(dì)圖
&nbΩ'sp; setMapEvent();÷←π✘//設置地(dì)圖事(shì)件(jiàn)
&nb♠ε≥sp; addMapControl();//向地(dì)圖添加控件(jiàn)×£&
&nb'φsp; addMarker()₽€;//向地(dì)圖中添加marker
}
//創建地(dì)圖函數(α↓&≈shù):
function♣§ createMap(){
&<& ₹nbsp; var map = new BMaγ™±αp.Map("dituContent");//在百度地(dì)圖容器(qì)中 ₽≈"創建一(yī)個(gè)地(dì)圖
÷£Ω var point =≤≠ new BMap.Point(121.565057"",30.923209);//定義一(yī)個(gè)中心點坐λ&(zuò)标
♣≈ map.centerA≠ ndZoom(point,18);//設 ↔✔定地(dì)圖的(de)中心點和(hé)坐(zuò←λσ×)标并将地(dì)圖顯示在地(dì)圖容器(q™Ω↕ì)中
&nb•☆♦sp; wi✘$ndow.map = map;//将ma✘← p變量存儲在全局
}
//地(dì)圖事(shìπ₹)件(jiàn)設置函數(shù):
functi∑★±>on setMapEvent(){
≤₩✔σ map.enableDraggi&$ng();//啓用(yòng)地(dì)圖拖拽事(shì)件(£∑♣jiàn),默認啓用(yòng)(可(kě)不(bù)寫)
&≥↕∑nbsp; map.enabl₽eScrollWheelZoom();//啓用(yòng)地(dì)圖滾輪放(↑>fàng)大(dà)縮小(xiǎo)
&nbsφ φ♥p; map.enableDoubleClicβ₽↕kZoom();//啓用(yòng)鼠标€↑雙擊放(fàng)大(dà),默認啓用(yòng)(可(¥€kě)不(bù)寫)
&n✘¥≥bsp; ©™✘≥ map.enableKeyboard();¥✔//啓用(yòng)鍵盤上(shàng)下(xià)左右鍵移動地(d§β♥ì)圖
}
//地≤σβλ(dì)圖控件(jiàn)添加函數(shù):
function addMapContr$→↓®ol(){
 α¶↕£; //向地(dì)圖中添加縮放(fàng)控件∑Ω✘×(jiàn)
var ctrl_nav = new↑¥↔♣ BMap.NavigationControl({anch¥&$©or:BMAP_ANCHOR_TOP_LEFT,ty☆←pe:BMAP_NAVIGATION_CONTROL_LARGE});
map.addContrδε>×ol(ctrl_nav);
α& //向地(dì)圖中添加縮略圖控件↔♠(jiàn)
var ctrl_ove = new $♣BMap.OverviewMapControl({anchor:BMAP_AN→•™↔CHOR_BOTTOM_RIGHT,isOpen:1}£');
map.ad ↕¶dControl(ctrl_ove);
&nbs≤←p; //向地(dì)圖中添加比例☆¥₹尺控件(jiàn)
var ctrl_sσφca = new BMap.ScaleControl({anch§∏☆λor:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(c→®♣↓trl_sca);
}
//标注點數(shù)組
varα×£× markerArr = [{title:" €♦Wit-Color",content:"Addrγ©&☆ess:No. 1959 S∞∏hangsu Road, Qingcun♥δ✘ Town, Fengxia∞♣n District, Shδ anghai, China₩∞.201414<br/>Tel:+86-21-54881966,&β×↑∞amp;nbsp;Mob.:+86-18017197700",poin&♣γδt:"121.564774|30.923248",isOpe™•n:0,icon:{w:21,h:21,↕÷πεl:0,t:0,x:6,lb:5}}
¥♠¶ ];
//創建marker
function £↓∞addMarker(){
€ fo£←∞ r(var i=0;i<markerA↑"rr.length;i++){
&πγ σnbsp; var j←son = markerArr[i];
&nb∞ sp; ÷÷♣✔ var p0 = json.₹>₽point.split("|")[0];
&nb ↕sp; &nbΩ∞σsp; var p1 = json.point.s¥φ₽©plit("|")[1];
&₹>nbsp; &nb λ•®sp; var point = ne ±↕w BMap.Point(p0,p1);
&★>★nbsp; &nbs &₹πp; var iconImg = createIcon(json.→∞icon);
&n♠↔™÷bsp; &nbs<★¥p; var m"←§arker = new BMap.Marker(≥& point,{icon:iconImg}$ש>);
&↕∑nbsp; §$≠ var iw = creatφ£∞&eInfoWindow(i);
&nb∏♠λsp; var label =∑'≥∏ new BMap.Label(json.title→ ,{"offset":new BMap.©¥δSize(json.icon.lb-json.iε•★con.x+10,-20)});
 α↑↑&; φ≈®marker.setLabel(label);≥®≠
&nφ©✔πbsp; &nbs p; map.addOverlay(markeφ₩r);
 ≥β; &n♠$∞©bsp; label.setStyle({€☆♦
δ &n λbsp; ¥ &nbs✔≤&®p; &¥♦₩®nbsp; borderColo≤≥λ₽r:"#808080",
&nb <↔sp; &'♠nbsp; &n™≈bsp; ≈∑↕ &₽ nbsp; color:"#333",
•↑₽∑ &nb♦®•♦sp; &nb λ☆>sp; &™✔✘nbsp; &nb₽♣Ωsp; cursor:"↕Ωpointer"
&♠∞×↓nbsp; &nbs §₹p; });
φ≠
&nbs®Ω≤p;  ¶"♦→;(function(){
&nb₽€✘↑sp; &nb ÷sp;var index = i;
&nb✘γ≤©sp; &nbs®₹p; var _iw $δ = createInfoWindow(i)®₹₩;
&nb÷ ♥∏sp;  ✘ ≤♦; var _marker = marker;
&↑↑nbsp; &>✘nbsp; _marke$£©r.addEventListener("click",func∑≤§tion(){
&n♦★±≥bsp; ¥× &nbs←€₽™p; this.opλ$£εenInfoWindow(_iw);
&nbφ✔sp; &nbs®£p; ☆¥ });
 λ∑; ₩ _iw.addEventList•≤™γener("open",function(){
♠γ≈ &n≈€€bsp; _marker↕.getLabel().hide();
&n ↕&γbsp; &nb♦§sp; })
&nφ≤bsp; &nbγ® sp; _iw.addEveβ★₹ntListener("close",fun£®ction(){
&nbs"βp; &★>€nbsp;  →δ; _marker.getL↑∑↓abel().show();
&n€¶bsp;  × $; })
& ∞nbsp; &n&₹βbsp;label.addEventListener("click",fun∏₽ction(){
&nbsΩ₹£δp; &n≥γ bsp; &n∏♦↓₹bsp; _marker.openInfoWindow(_iw±§β₹);
&n→ ♠✘bsp; &☆Ωnbsp; &nbσ♠≥sp; })
≠¥©↔ &n'≥≠bsp; if(!!json.isO¶×€↓pen){
&nbs£≠p; &nbs∏♣©p; &nbs>∑↑ p; label.hide()♣★Ω;
&nbsΩ£σλp; &nbsφ↕♠φp; &♦ε™nbsp;_marker.openInf™∑§₩oWindow(_iw);
&↑✘≈nbsp; &nbsα ♣∞p; }
λ&₩ &n®βbsp;})()
™σ }
}
//創建>₩φ₩InfoWindow
func×¥tion createInfoWindow(i){§
&nbs§φ₩p; var json = markerArr[i];•α
&nb ↔σπsp; ∞α≥≥var iw = new BMap.InfoWindow("<b clλ✘ass='iw_poi_title' title='" + js♥♣©on.title + "'>" +∏✘₹↔ json.title + "</b><div class=÷®>≈'iw_poi_content'>"+json★§.content+"</div>");
&nb↓sp; return iw;
}
//創建一(yī)個(gè≤£♣)Icon
function ← createIcon(json){
&nbλ±™sp; var icon = new BMap'∏≈<.Icon("http://app.baidu.com/map✔γ¥/images/us_mk_icon.png", new BMap.±€≈Size(json.w,json.h),{imageOffset: new BΩ₩Map.Size(-json.l,-json.t),infoWiαδndowOffset:new BMap.Size(json.lb+5,1)γ,offset:new BMap.Size(json.x,json.h)})≤★®
&nbs→Ω®↕p; return icon;
}
initM©₩∑ap();//創建和(hé)初始化(huà)地÷↕→∏(dì)圖
</script>
</html>