模板调用地图代码
{baidumap:view($.map)}
经度,纬度,缩放比例
{$maps=explode(\,,$.map)}
{$maps.0},{$maps.1},{$maps.2}
文章字段调用代码
//$map改为你的文章字段名
{$mappos=explode(\,,$map)}
{if count($mappos)!=3}
未标记
{else}
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=MeFu3gZv7wcBC2RWUL19BgOG"></script>
<div id="map" style="width:400px;height:400px"></div>
<script type="text/javascript">
var map = new BMap.Map("map");
var point = new BMap.Point({$mappos.0},{$mappos.1});
map.centerAndZoom(point,{$mappos.2});
var marker = new BMap.Marker(point);
map.addOverlay(marker);
map.enableScrollWheelZoom(true);
</script>
{/if}
栏目变量调用代码
//$.map改为你的栏目变量名
{$mappos=explode(\,,$.map)}
{if count($mappos)!=3}
未标记
{else}
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=MeFu3gZv7wcBC2RWUL19BgOG"></script>
<div id="map" style="width:400px;height:400px"></div>
<script type="text/javascript">
var map = new BMap.Map("map");
var point = new BMap.Point({$mappos.0},{$mappos.1});
map.centerAndZoom(point,{$mappos.2});
var marker = new BMap.Marker(point);
map.addOverlay(marker);
map.enableScrollWheelZoom(true);
</script>
{/if}