nd==0){ arrow.style.background = "url(/Application/Home/View/default/images/dt_lanj.png) no-repeat 0px -10px"; }else if(this._recommend==1){ arrow.style.background = "url(/Application/Home/View/default/images/dt_honj.png) no-repeat 0px -10px"; } arrow.style.position = "absolute"; arrow.style.width = "31px"; arrow.style.height = "9px"; arrow.style.top = "27px"; arrow.style.left = "0px"; arrow.style.overflow = "hidden"; div.appendChild(arrow); div.onmouseover = function(){ div.style.zIndex="9999"; div.style.className="markon" div.style.background = "#f60"; div.style.borderRadius="3px"; div.style.borderBottomLeftRadius="0px"; em.style.background="#ff9600"; arrow.style.background="url(/Application/Home/View/default/images/dt_huangj.png) no-repeat"; arrow.style.backgroundPosition = "0px -9px"; } div.onmouseout = function(){ div.style.zIndex="-1"; if(that._recommend==null||that._recommend==0){ div.style.background = "#2160de"; em.style.background="#4580f6"; arrow.style.background = "url(/Application/Home/View/default/images/dt_lanj.png) no-repeat 0px -10px"; }else if(that._recommend==1){ div.style.background = "#ef0000"; em.style.background="#ff4e4e"; arrow.style.background = "url(/Application/Home/View/default/images/dt_honj.png) no-repeat 0px -10px"; arrow.style.backgroundPosition = "0px -18px"; } div.style.borderRadius="3px"; div.style.borderBottomLeftRadius="0px"; } map.getPanes().markerPane.appendChild(div); return div; } ComplexCustomOverlay.prototype.draw = function(){ var map = this._map; var pixel = map.pointToOverlayPixel(this._point); this._div.style.left = pixel.x - 0 + "px"; this._div.style.top = pixel.y - 40 + "px"; } ComplexCustomOverlay.prototype.addEventListener = function(event,fun){ this._div['on'+event] = fun; } map.addControl(new BMap.NavigationControl()); map.addControl(new BMap.ScaleControl()); map.addControl(new BMap.OverviewMapControl()); map.setCurrentCity(city); var point = new BMap.Point(schoolX, schoolY); map.centerAndZoom(point, 15); map.addEventListener("load", function(){ //mapload(); }); ShowHtmlString('地图加载','
  地图载入中,如加载失败,请点击刷新
',400,100); map.addEventListener("tilesloaded", function(){ ClosePop(); if(keyword!="" && typeof(keyword)!="undefined" && keyword!='您附近的街道/地标/建筑物'){ addressSearch(); } }); function mapload(){ var schoolPath = $("#schoolPath").val(); var score = $("#schoolScore").val(); var title = $("#schoolName").val(); var address = $("#schoolAddress").val(); var logo = $("#schoolLogo").val(); var tel = $("#tel").val(); //渲染右侧列表 var schoolInfo = ""; schoolInfo +='
'; schoolInfo +='

'; schoolInfo +=''+title+' '; schoolInfo +='

'; schoolInfo +='

推荐度:'+score+'

'; schoolInfo +='
'; var busLineStr = ""; if($("#json").val()!=null&&$("#json").val()!=""){ var mappoint = $("#json").val(); mappoint = eval("(" + mappoint + ")"); var busIdArray = new Array(); var busList = mappoint.list; if(busList.length>0){ busLineStr +=''; map.closeInfoWindow(); $("#findDiv").hide(); $("#schoolLable").hide(); $("#busPointLable").show(); $("#search_list").html(""); $("#search_list").html(schoolInfo+busLineStr); } for(var i =0;i   班车地图载入中...',400,100); $("a.fstrong").attr("class",""); $("#bus"+lineId).attr("class","fstrong"); jQuery.post("/Search/getLineJson.html",{"lineId":lineId},function(json){ if(json.error){ alert(json.error); return; } var busPointList = json.list; if(busPointList.length>0){ map.clearOverlays(); var busPoints = new Array(); for(var i=0;i班车时间:'+busPointObj.date+'

'; busPointInfoContent +='
'; busPointInfoContent +='
'; busPointInfoContent +=''; busPointInfoContent +='
'; busPointInfoContent +='
'; busPointInfoContent +=''+title+''; busPointInfoContent +='
'; busPointInfoContent +='评分:'+score+'
'; busPointInfoContent +='地址:'+address+'
'; busPointInfoContent +='
'; busPointInfoContent +=''; var busPointOpts = {offset : new BMap.Size(0, -25), title : ""}; var busPointInfoWindow =new BMap.InfoWindow(busPointInfoContent,busPointOpts); map.openInfoWindow(busPointInfoWindow,busPoint); }); })(); } } },"json"); }); })(); } var lineId = $("#busLineId").val(); if(lineId!=null&&lineId!=""){ $("#bus"+lineId).trigger("click"); } }else{ $("#map_right").hide(); } var point = new BMap.Point(schoolX,schoolY); var showType = $("#showType").val(); var innerContent ="1"; var marker = new ComplexCustomOverlay(point, $("#schoolName").val(),innerContent,0); map.addOverlay(marker); var infocontent= ""; var isjzkey = 0; marker.addEventListener("mouseover", function(){ jQuery.post("/Search/getKechengJson.html", {"schoolId":schoolId},function(json){ infocontent=''; var messageList = json.list; infocontent += '
'+title+' '+score+'分
'; infocontent += '
'; infocontent += '
'; infocontent += '
'; infocontent += '
'+title+'
'; infocontent += '评分:'+score+'分    电话:'+tel+'
'; infocontent += '地址:'+address+'
'; infocontent += '
'; if(messageList.length>0){ infocontent +='
    '; for(var k=0;k'; if(messageList[k].pric!=null&&messageList[k].pric>0){ infocontent +='价格:'+messageList[k].pric+'元'; }else{ infocontent +='价格:'+messageList[k].jiage+'元'; } infocontent +=''; infocontent +='我要报名'; infocontent +=''; } infocontent +=''; 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("附近班车"); }); });