go+'" width="80" height="60">'; infocontent += '
'+title+'
'; infocontent += '评分:'+score+'分    电话:'+tel+'
'; infocontent += '地址:'+address+'
'; infocontent += ''; if(messageList.length>0){ infocontent +=''; } infocontent +=""; var opts = {offset : new BMap.Size(0, -25), title : ""}; var infoWindow =new BMap.InfoWindow(infocontent,opts); map.openInfoWindow(infoWindow,point); },"json"); }); } function addressSearch(){ var searchType = 2; var city = $("#cityname").val(); var inputAddress = document.getElementById("address").value; if(inputAddress==null||inputAddress=="")return; var options = { onSearchComplete: function(results){ // 判断状态是否正确 if (local.getStatus() == BMAP_STATUS_SUCCESS){ var s = []; s.push('
'); s.push('
'); s.push('
    '); for (var i = 0; i < results.getCurrentNumPois(); i ++){ // 默认打开第一标注的信息窗口 var selected = ""; s.push('
  1. '); s.push(' '); s.push('' + results.getPoi(i).title.replace(new RegExp(results.keyword,"g"),'' + results.keyword + '') + ''); s.push(' - ' + results.getPoi(i).address + ''); s.push('
  2. '); s.push(''); } s.push('
'); document.getElementById("searchbaidulist").innerHTML = s.join(""); dialog('请选择您的位置',"id:searchbaidulist",500+"px","auto",""); $("#floatBox").on("click",".title span",function(e){ $("#address").val(''); }); } //if(results.getCurrentNumPois()>0){ // $("#ss_tis").show(); //} } }; var local = new BMap.LocalSearch(map,options); local.search(inputAddress); } function newAddressSearch(){ var searchType = 2; var inputAddress = document.getElementById("newaddress").value; if(inputAddress==null||inputAddress=="")return; var options = { onSearchComplete: function(results){ // 判断状态是否正确 if (local.getStatus() == BMAP_STATUS_SUCCESS){ var s = []; s.push('
'); s.push('
'); s.push('
    '); for (var i = 0; i < results.getCurrentNumPois(); i ++){ // 默认打开第一标注的信息窗口 var selected = ""; s.push('
  1. '); s.push(' '); s.push('' + results.getPoi(i).title.replace(new RegExp(results.keyword,"g"),'' + results.keyword + '') + ''); s.push(' - ' + results.getPoi(i).address + ''); s.push('
  2. '); s.push(''); } s.push('
'); document.getElementById("searchbaidulist").innerHTML = s.join(""); dialog('请选择您的位置',"id:searchbaidulist",500+"px","auto",""); } //if(results.getCurrentNumPois()>0){ // $("#ss_tis").show(); //} } }; var local = new BMap.LocalSearch(map,options); local.search(inputAddress); } function openWinFuns(x,y,type,str){ if(!schoolId){ schoolId = 0; } location.href="/Search/mapSearch.html?addressX="+x+"&addressY="+y+"&searchType="+type+"&sid="+schoolId+"&searchKey="+encodeURI(str); } function searchAreaMap(id){ location.href = "/Search/mapSearch.html?area="+id; } function searchBusinessAreaMap(id){ location.href = "/Search/mapSearch.html?businessArea="+id; } $(function(){ mapload(); $('#address').bind('keyup', function(event){ if (event.keyCode=="13"){ addressSearch(); } }); $('#newaddress').bind('keyup', function(event){ if (event.keyCode=="13"){ newAddressSearch(); } }); $("#jx").click(function(){ $("#jx").attr("class","search_jx"); $("#bc").attr("class",""); $("input[type=radio][value=1]").attr("checked",'checked'); $("#searchType2").removeAttr("checked"); $("#searchType").val(1); $("#addressSubmit").val("附近驾校"); }); $("#bc").click(function(){ $("#bc").attr("class","search_jx"); $("#jx").attr("class",""); $("#searchType1").removeAttr("checked"); $("input[type=radio][value=2]").attr("checked",'checked'); $("#searchType").val(2); $("#addressSubmit").val("附近班车"); }); });