$(function(){ if (false) { Fai.ing("当前设置的坐标数据有问题,为保证百度API正常使用,现已重置为默认坐标。请您联系客服处理。", true); } if(1 == 1){ if( typeof BMap == 'undefined' ){ var mapContainer = $('#mapContainer316'); mapContainer.css({ color: 'red', position: 'relative', textAlign: 'center' }); var msg = $('
').css({ position: 'absolute', top:'50%', width:'100%' }).text('加载地图失败,请刷新重试'); mapContainer.append( msg ); }else{ var mMap = new BMap.Map( 'mapContainer316' ); var mPoint = new BMap.Point( 113.406793,22.938285 ); var oPoint = new BMap.Point( 113.406793,22.938285 ); var mInfoWindow = new BMap.InfoWindow( "广州市番禺区大龙街石岗东村振兴南路8号C1-C2", { width:'auto', height:'auto', title:'', enableAutoPan:false }); var mMarker = new BMap.Marker( oPoint ); mMarker.addEventListener('infowindowopen', function(e) { setTimeout(function(){ var moduleWidth = 730; var diff = 0; if( moduleWidth < 255 ){ diff = 730 - 255; if( diff < -100 ){ diff = -100; } } var pop = $('#mapContainer316').children('#platform').children('#mask').next().children('div:first').children('div.pop'); var divTop = pop.children('.top'); divTop.css({ width: (202+diff) + 'px' });// top-center source [202px] divTop.next().css({ left: (227+diff) + 'px' });// top-right-radius source [227px] //middle-center source [250px] if( $.browser.msie ){ if( $.browser.version < 8 ){ pop.children('.center').css({ width: (250+diff+2) + 'px' }); }else{ pop.children('.center').css({ width: (250+diff) + 'px' }); } } else { pop.children('.center').css({ width: (250+diff) + 'px' }); } var divBottom = pop.children('.bottom'); divBottom.css({ width: (202+diff) + 'px' });// bottom-center source [202px] divBottom.next().css({ left: (227+diff) + 'px' });// bottom-right-radius source [227px] pop.children('div:last').css({ width: (220+diff) + 'px' });// middle-center text source [220px] pop.children('img:first').css({ left: (227+diff) + 'px' });// close img button source [227px] }, 100); }) mMarker.addEventListener('click', function(e) { if( mInfoWindow.isOpen() ){ this.closeInfoWindow(); } else { this.openInfoWindow(mInfoWindow); } }); mMap.centerAndZoom( mPoint, 17 ); mMap.disableDoubleClickZoom(); mMap.addControl( new BMap.NavigationControl() ); mMap.addOverlay( mMarker ); mMarker.openInfoWindow( mInfoWindow ); } } });