{imp:"c_pub/m-frame"}<!--继承父模板-->

{block:init}{:parent}
<?php
$map = req('map'); //39.9151,116.404,
$maps = wmpUser::convMap($map); //坐标转化
$mapsql = basSql::whrMap($maps['y'],$maps['x'],3,1,'map'); 
$mdtitle = $sbtitle = 'Local'; 
?>{/block:init}

{block:brnav}{:clear}{/block:brnav}

{block:main}
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>

<ul class="mod-user">
  <li class="type">
  <b class="right">-</b>
  附近信息
  </li>
  <li>
  <i class="atype">坐标</i>
  <i class="title">{=$maps[0]}</i>
  </li>
  <li>
  <i class="atype">地址</i>
  <i class="title"><input type="text" id="map_address" value="" style="width:100%;"></i>
  </li>
  
  <li>
  <i class="atype">sql参考</i>
  <i class="title"><input type="text" value="{=$mapsql}" style="width:100%;"></i>
  </li>
  <li class="tc">
  <i><a href='?fid=201&map=113.757,23.0081&type=company'>企业会员</a></i> - 
  <i><a href='?fid=201&map=113.757,23.0081&type=govern'>政府机构</a></i> - 
  <i><a href='?fid=201&map=113.757,23.0081&type=organize'>非盈利组织</a></i>
  </li>
</ul>

<div class="clear"></div>

<!--不显示地图,就不要此行-->
<div id="mapObj" style=" width:100%; height:360px;"></div>

{/block:main}

{block:exend}
<script type="text/javascript">
var point = new BMap.Point(<?php echo $maps[0]; ?>);
// 把坐标转化成地址
var geoc = new BMap.Geocoder();  
var pt = point;
geoc.getLocation(pt, function(rs){
    var addComp = rs.addressComponents;
    var address = addComp.province + ", " + addComp.city + ", " + addComp.district;
    if(addComp.street){ address += ", " + addComp.street; }
    if(addComp.streetNumber){ address += ", " + addComp.streetNumber; }
    address += '(附近)';
    document.getElementById('map_address').value = address;
});
// 显示地图(不显示地图,就不要一下代码)
var map = new BMap.Map('mapObj');
map.centerAndZoom(point,12);
var marker = new BMap.Marker(point);  
map.addOverlay(marker); 
map.addControl(new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM})); //缩放
map.addControl(new BMap.ScaleControl()); // 比例尺
//map.addControl(new BMap.MapTypeControl());   //添加地图类型控件
map.enableScrollWheelZoom();
</script>
{/block:exend}
