資源描述:
《百度地圖的實(shí)現(xiàn)標(biāo)注以及標(biāo)注提示框》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、$(function(){//最后加載的js代碼findDimensions();map=newBMap.Map("container");//創(chuàng)建地圖實(shí)例//varpoint=newBMap.Point(116.404,39.915);//創(chuàng)建點(diǎn)坐標(biāo)map.centerAndZoom("北京");map.enableScrollWheelZoom();//開(kāi)啟鼠標(biāo)滾輪縮放map.enableKeyboard();//開(kāi)啟鍵盤控制map.enableContinuousZoom();//開(kāi)啟連續(xù)縮放效果map.enableInertialDr
2、agging();//開(kāi)啟慣性拖拽效果//setTimeout("GetNewDrivingStatus()",1000);vardates=$("#begin,#end").datepicker({defaultDate:"+1w",changeMonth:true,numberOfMonths:1,dateFormat:"yy-mm-dd",onSelect:function(selectedDate){varoption=this.id=="begin"?"minDate":"maxDate",instance=$(this).data
3、("datepicker"),date=$.datepicker.parseDate(instance.settings.dateFormat
4、
5、$.datepicker._defaults.dateFormat,selectedDate,instance.settings);dates.not(this).datepicker("option",option,date);}});$(".a2").click(function(){varhtmlStr=$(this).prev();//.html();//獲取黑名單車牌的信息varnewob
6、j=htmlStr.prev().val();newobj=newobj.replace(newRegExp('(^
7、[^\\])\"\\/Date\((-?[0-9]+)\)\\/\"','g'),"$1newDate($2)");varobj=eval("("+newobj+")");//調(diào)用MapInfo控制器中的Search方法,obj是參數(shù),$.get("@Url.Content("~/Detector/FaceDetection")",obj,function(list){varpoints=newArray(
8、);//定義一個(gè)坐標(biāo)對(duì)象集合//遍歷以;分割的json對(duì)象集合并處理敏感字符以免出誤區(qū)$.each(list.split(";"),function(index,item){if(item=="")return;item=item.replace(newRegExp('(^
9、[^\\])\"\\/Date\((-?[0-9]+)\)\\/\"','g'),"$1newDate($2)");varobj=eval(item);points.push(newBMap.Point(obj.DeviceLatitude,obj.D
10、eviceLongitude));//坐標(biāo)對(duì)象集合中添加坐標(biāo)對(duì)象});map.setViewport(points);//根據(jù)坐標(biāo)設(shè)置地圖視野varpolyline=newBMap.Polyline(points,{strokeColor:"blue",strokeWeight:6,strokeOpacity:0.5});map.addOverlay(polyline);$.each(list.split(";"),function(index,item){if(item=="")return;AddOne(item);});});});$(
11、"#search").click(function(){varobj={shortLicense:$("#shortlicense").val(),License:$("#license").val(),beginDate:encodeURI($("#begin").val()),endDate:encodeURI($("#end").val())};if(obj.shortLicense.toString()==""&&obj.License.toString()==""){alert("請(qǐng)選擇要查看的黑名單車牌!");returnfals
12、e;}if(!obj.beginDate
13、
14、obj.beginDate.toString()==""){alert("請(qǐng)選擇起始日期!");returnfalse;