安卓和ios跳转百度、高德、苹果地图 定位坐标偏差

效果截图展示: 

一、高德地图举例:

1、通过接口拿到有偏差的经纬度。
2、通过高德api进行经纬度转化。经纬度转化url地址:https://restapi.amap.com/v3/assistant/coordinate/convert

3、跳转转到高德App如图:

window.location.href = "iosamap://viewMap?sourceApplication=appname&poiname=" + 
    "地址名称" + 
    "&lat=" + 
    "纬度" + 
    "&lon=" + 
    "经度"+ 
    "&dev=0";

二、百度, Web服务API | 百度地图API SDK

1、通过接口拿到有偏差的经纬度。
2、通过api进行经纬度转化。

扫描二维码关注公众号,回复: 14975570 查看本文章

3、跳转转到高德App如图: 

//苹果手机
window.location.href = 
    "baidumap://map/geocoder?location="  + 
    this.lat  + 
    "," + 
    this.lng + 
    "&coord_type=gcj02&src=ios.baidu.openAPIdemo";

 三、腾讯地图

window.location.href =
          "qqmap://map/routeplan?type=drive&from=我的位置&fromcoord=" +
          this.latitude +
          "," +
          this.longitude +
          "&to=" +
          this.address +
          "&tocoord=" +
          this.lat +
          "," +
          this.lng +
          "&referer=申请的key";

可参考:iOS APP 跳转百度、高德、苹果地图 定位偏差 - 简书

猜你喜欢

转载自blog.csdn.net/qq_39891453/article/details/122192406