File: /www/wwwroot/www.sceysls.com/wp-content/themes/Zing-Pro/template-parts/modular/17.php
<?php
$modular_title = $id['modular_title'] ?: '';
$modular_subtitle = $id['modular_subtitle'] ?: '';
$md5 = md5( $id['modular_17_dzmc'] );
?>
<div class="<?php if( $id['modular_no_mobile'] ){ ?>mobile_modular_no <?php } ?>module-full-screen module-full-17">
<div class="module-inner not-animated"<?php echo data_animate();?>>
<div class="page-width">
<div class="module-full-screen-title">
<h2><?php echo $modular_title; ?></h2>
<?php if( $modular_subtitle ){?>
<div class="module-title-content">
<i class="mark-left"></i>
<h3><?php echo $modular_subtitle;?></h3>
<i class="mark-right"></i>
</div>
<?php }?>
</div>
<div id="map_contact" class="version_2">
<style type="text/css">
#a<?php echo $md5;?>{width:100%;height:500px;margin-top: 30px;}
.modular_17_dzmc{font-size:20px}
.modular_17_dtxxms{margin-top:10px}
@media only screen and (max-width:767px){
#a<?php echo $md5;?>{height:250px}
}
</style>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<?php echo $id['modular_17_ak'];?>"></script>
<div id="a<?php echo $md5;?>"></div>
<script type="text/javascript">
// 百度地图API功能
var sContent =
"<h4 class='modular_17_dzmc'><?php echo $id['modular_17_dzmc'];?></h4>" +
"<p class='modular_17_dtxxms'><?php echo $id['modular_17_dtxxms'];?></p>" +
"</div>";
var map = new BMap.Map("a<?php echo $md5;?>");
var point = new BMap.Point(<?php echo $id['modular_17_zuobiao'];?>);
var marker = new BMap.Marker(point);
var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
map.openInfoWindow(infoWindow,point); //开启信息窗口
map.centerAndZoom(point, 15);
map.addOverlay(marker);
marker.addEventListener("click", function(){
this.openInfoWindow(infoWindow);
//图片加载完毕重绘infowindow
document.getElementById("imgDemo").onload = function (){
infoWindow.redraw(); //防止在网速较慢,图片未加载时,生成的信息框高度比图片的总高度小,导致图片部分被隐藏
}
});
</script>
</div>
</div>
</div>
</div>