迅睿开源框架是一款PHP8高性能·简单易用的PHP开源开发框架, 基于MIT开源许可协议发布,不限制商业使用,以多端互联为设计理念, 支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
业务经理
微信扫描以上二维码
028-61286886
在线咨询
如何保存当前用户的地图坐标,然后按照坐标远近列出相应的内容
{dr_baidu_map_js()} <script type="text/javascript"> // 百度地图定位坐标 var geolocation = new BMap.Geolocation(); geolocation.getCurrentPosition(function(r){ if(this.getStatus() == BMAP_STATUS_SUCCESS){ var pos = r.point.lng+','+r.point.lat; alert('定位成功:'+pos); } else { alert('定位失败:'+this.getStatus()); } },{enableHighAccuracy: true}); </script>
{dr_baidu_map_js()} <script type="text/javascript"> // 百度地图定位坐标 var geolocation = new BMap.Geolocation(); geolocation.getCurrentPosition(function(r){ if(this.getStatus() == BMAP_STATUS_SUCCESS){ var pos = r.point.lng+','+r.point.lat; alert('定位成功:'+pos); } else { alert('定位失败:'+this.getStatus()); } },{enableHighAccuracy: true}); </script>自己拿去调用就行,我之前做过定位搜索