PHP Modoer php页面和html调用地图

              最近在学习modoer点评系统,感觉很有意思。说一说调用地图的用法,首先来看看php页面怎么调用51地图。

首先在\static\javascript\map下有个51ditu.js和baidu.js

先写一段js代码,用iframe显示出地图

<script type="text/javascript">
   $(document).ready(function(){
		var point1 = point2 = '';
		var width = 730;
		var height = 450;
		var title=$('#title').val();
		point1 = $('#map_lng').val();
		point2 = $('#map_lat').val();;
		var url = Url('modoer/index/act/map/width/'+width+'/height/'+height+'/p1/'+point1+'/p2/'+point2);
		if(point1 != '' && point2 != '') {
			url += '&show=yes';
		}
		if($('#area_1').val()) {
			url += '&city_id=' + $('#area_1').val();
		}
		if(title) {
			url += '&title=' + title;
		}
		var html = '<iframe src="' + url + '" frameborder="0" scrolling="no" width="'+width+'" height="'+(height+10)+'" id="ifupmap_map"></iframe>';
		$('#showmap').html(html);
});
</script>

html代码

  <ul class="tancount" style="display:none;">
          <li>
          <div>
          <input type="hidden" id="title" value="<?php echo $sellerxxx_detail['name'] ?>"  />
          <input type="hidden" id="map_lng" value="<?php echo $sellerxxx_detail['map_lng'] ?>"  />
          <input type="hidden" id="map_lat" value="<?php echo $sellerxxx_detail['map_lat'] ?>"  />
          </div>
          <div id="showmap"></div>
          </li>
        </ul>




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值