Home > front end >  Consult - javascript development baidu map
Consult - javascript development baidu map

Time:09-18

Javascript development baidu map

1, the complete content, according to the different formats (A, B, C, D, E), with different ICONS (complete)

2, click on the marked points respectively markerArr array in the title, yetai content such as what can pop-up annotation points so far, but it's always markerArr array data within the last one, click on the marked point after excuse me, how can the corresponding marked points to group information,

Great god give directions, thank you very much, thank you,

 


<meta charset="UTF-8">
<meta name="viewport"
The content="width=device - width, user - scalable=no, initial - scale=1.0, the maximum - scale=1.0, minimum - scale=1.0" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="ie=edge" & gt;
BaiDu_Map & lt;/title> <br/><The script type="text/javascript" SRC="https://api.map.baidu.com/api? Type=webgl& V=1.0 & amp; Ak="& gt; </script> <br/><style type="text/CSS" & gt; <br/>Body, HTML, # allmap {width: 100%; height: 100%; overflow: hidden; margin:0; The font-family: "Microsoft jas black"; } <br/></style> <br/><br/></head> <br/><body> <br/><Div id="allmap" & gt; </div> <br/></body> <br/><br/><script language="JavaScript" & gt; <br/><br/><br/>Var markerArr=[<br/><br/>{<br/><br/>Title: "name: Beijing supermarket (headquarters)," <br/>Point: "116.333405, 39.974042," <br/>Address: haidian district double elm, <br/>Tel: "010-88888888," <br/>Yetai: "Y" <br/><br/>}, <br/><br/>{<br/>Title: "name: supermarket hair (ShuangYuShu stores)", <br/>Point: "116.331637, 39.973424," <br/>Address: "north third ring road, haidian district of Beijing ShuangYuShu kiosk 7", <br/>Tel: "010-62640346," <br/>Yetai: "A" <br/>}, <br/>{<br/>Title: "name: supermarket hair (science city)", <br/>Point: "116.324596, 39.986931," <br/>Address: haidian district zhongguancun south road no. 77, <br/>Tel: "010-62551377," <br/>Yetai: "B" <br/>}, <br/>{<br/>Title: "name: supermarket hair (fair village shop)", <br/>Point: "116.326296, 39.960478," <br/>Address: address: Beijing haidian district "fair village street near 01, tower 2, 1, base business", <br/>Tel: "010-88570042," <br/>Yetai: "C" <br/>}, <br/>{<br/>Title: "name: supermarket hair (Bai Yilu stores)", <br/>Point: "116.33458, 39.951854," <br/>Address: address: "Beijing haidian district community for the southern district 22, the China Meteorological Administration building bottom", <br/>Tel: "010-58995553," <br/>Yetai: "D" <br/>}, <br/>{<br/>Title: "name: supermarket hair (shangdi shop)", <br/>Point: "116.318805, 40.03683," <br/>Address: address: shangdi information road 19 - "3", <br/>Tel: "010-62971745," <br/>Yetai: "E" <br/>}, <br/><br/>{<br/>Title: "name: supermarket hair (XXXX)", <br/>Point: "116.318805, 40.03620," <br/>Address: "north third ring road, haidian district of Beijing," <br/>Tel: "010-62640346," <br/>Yetai: "A" <br/>}, <br/><br/>]; <br/><br/><br/><br/>Map_init (); <br/><br/>The function map_init () {<br/>//GL version namespace for BMapGL <br/>//hold down the right mouse button, modify Angle and Angle <br/>Var map=new BMapGL. The map (" allmap ");//create the Map instance <br/>Map. CenterAndZoom (new BMapGL. Point (116.333405, 39.974042), 13);//initialize the map, set the center coordinates and map level <br/>Map. EnableScrollWheelZoom (true);//open the mouse wheel zoom <br/><br/><br/>//custom formats icon image address and size <br/>Var zIcon=new BMapGL. Icon (' images/z.p ng, new BMapGL Size (30, 30));//supermarket hair headquarters office building <br/>Var aIcon=new BMapGL. Icon (' images/Amy polumbo ng, new BMapGL Size (30, 30));//comprehensive supermarket <br/>Var bIcon=new BMapGL. Icon (' images/p. ng, new BMapGL Size (30, 30));//food supermarket <br/>Var cIcon=new BMapGL. Icon (' images/c.p ng, new BMapGL Size (30, 30));//life supermarkets <br/>Var dIcon=new BMapGL. Icon (' images/d.p ng, new BMapGL Size (30, 30));//fresh supermarket <br/>Var eIcon=new BMapGL. Icon (' images/e.p ng, new BMapGL Size (30, 30));//community supermarket <br/>Var fIcon=new BMapGL. Icon (' images/f.p ng, new BMapGL Size (30, 30));//the mound store <br/>Var lIcon=new BMapGL. Icon (' images/l.p ng, new BMapGL Size (30, 30));//supermarket hair rosen store <br/>Var hIcon=new BMapGL. Icon (' images/h.p ng, new BMapGL Size (30, 30));//co-op <br/>Var gIcon=new BMapGL. Icon (' images/g.p ng, new BMapGL Size (30, 30));//vegetable markets <br/>Var iIcon=new BMapGL. Icon (' images/i.p ng, new BMapGL Size (30, 30));//emergency supplies <br/><br/><br/>//store the latitude and longitude array <br/>Var point=new Array (); <br/><br/>//store marked points set <br/>Var marker=new Array (); <br/><br/>//store the tooltip window object array <br/>Var info=new Array (); <br/><br/>//setting allows information sends the message <br/>Var opts={height: 100, width: 200}; <br/><br/>//loop output markerArr arrays within <br/>for (var i=0; i<MarkerArr. Length; I++) {<br/>Var p0=markerArr [I]. Point. The split (', ') [0]; <br/>Var p1=markerArr [I]. Point. The split (', ') [1]; <br/>//the console. The log (windowinfo); <br/>Point [I]=new Windows. BMapGL. Point (p0, p1); <br/>The console. The log (point [I]); <br/>Marker [I]=new Windows. BMapGL. Marker (point [I]); <br/>//the console. The log (marker [I]); <br/><br/><br/>//by forms showed marked point picture <br/><br/>The switch (markerArr [I] yetai) {<br/>Case "A" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: aIcon}); <br/>break; <br/>Case "B" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: bIcon}); <br/>break; <br/>Case "C" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: cIcon}); <br/>break; <br/>Case "D" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: dIcon}); <br/>break; <br/>Case "E" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: eIcon}); <br/>break; <br/>Case "f" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: fIcon}); <br/>break; <br/>Case "l" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: lIcon}); <br/>break; <br/>Case "h" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: hIcon}); <br/>break; <br/>A case of "g" : <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: gIcon}); <br/>break; <br/>Case "I" is: <br/>Marker [I]=new Windows. BMapGL. Marker (point [I] and {icon: iIcon}); <br/>break; <br/>Default: <br/>nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/10822.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/10822.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/10821.html'>How to implement in the pop-up box using easyui data table is in it</a></div> <div class="detail-arr-right">Next:<a href='/frontend/10823.html'>C # multi-stage classification table query</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=JavaScript' target='_blank'>JavaScript</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>