资源描述:
《百度地图的实现标注以及标注提示框》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、$(function(){//最后加载的js代码findDimensions();map=newBMap.Map("container");//创建地图实例//varpoint=newBMap.Point(116.404,39.915);//创建点坐标map.centerAndZoom("北京");map.enableScrollWheelZoom();//开启鼠标滚轮缩放map.enableKeyboard();//开启键盘控制map.enableContinuousZoom();//开启连续缩放效果map.enableInertialDr
2、agging();//开启惯性拖拽效果//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+")");//调用MapInfo控制器中的Search方法,obj是参数,$.get("@Url.Content("~/Detector/FaceDetection")",obj,function(list){varpoints=newArray(
8、);//定义一个坐标对象集合//遍历以;分割的json对象集合并处理敏感字符以免出误区$.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));//坐标对象集合中添加坐标对象});map.setViewport(points);//根据坐标设置地图视野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("请选择要查看的黑名单车牌!");returnfals
12、e;}if(!obj.beginDate
13、
14、obj.beginDate.toString()==""){alert("请选择起始日期!");returnfalse;