You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.6 KiB
38 lines
1.6 KiB
{template 'header'}
|
|
<div id="head-bar">
|
|
<div class="head-bar">
|
|
<div class="head-bar-back"><a href="{if $back_link}{$back_link}{else}javascript:Dback();" id="back-{$js_pageid}{/if}" data-direction="reverse"><img src="{DT_MOB}static/img/icon-back.png" width="24" height="24"/></a></div>
|
|
<div class="head-bar-title">{$head_name}</div>
|
|
<div class="head-bar-right">
|
|
<a href="https://api.map.baidu.com/geocoder?address={$addr}&output=html&scr={$name}" rel="external" target="_blank"><span>全屏</span></a>
|
|
</div>
|
|
</div>
|
|
<div class="head-bar-fix" id="load-fix-{$js_pageid}" style="height:0;"></div>
|
|
<div class="head-bar-fix" id="head-fix-{$js_pageid}"></div>
|
|
</div>
|
|
<div id="bmap" style="width:100%;height:300px;"></div>
|
|
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={$map_key}"></script>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$('#bmap').height($(window).height() - {if $DT_MBS=='b2b'}64{else}44{/if});
|
|
// 百度地图API功能
|
|
var map = new BMap.Map("bmap");
|
|
var point = new BMap.Point(116.331398,39.897445);
|
|
map.centerAndZoom(point,12);
|
|
// 创建地址解析器实例
|
|
var myGeo = new BMap.Geocoder();
|
|
// 将地址解析结果显示在地图上,并调整地图视野
|
|
myGeo.getPoint("{$addr}", function(point){
|
|
if(point) {
|
|
map.centerAndZoom(point, 16);
|
|
var marker = new BMap.Marker(point);
|
|
map.addOverlay(marker);
|
|
var label = new BMap.Label("{if $name}<b>{$name}</b><br/>{/if}{$addr}",{offset:new BMap.Size(20,-10)});
|
|
marker.setLabel(label);
|
|
} else {
|
|
Dtoast('{$js_pageid}',"您选择地址没有解析到结果");
|
|
}
|
|
}, "中国");
|
|
});
|
|
</script>
|
|
{template 'footer'}
|