wx.openLocation打开微信内置地图,但是到这里去功能不能用
发布于 5 年前 作者 dzhu 15933 次浏览 来自 问答

到这里去方法代码:

openLocation(){
    wx.getLocation({
      type: 'gcj02', //返回可以用于wx.openLocation的经纬度
      success: function (res) {
        var latitude = res.latitude
        var longitude = res.longitude
        wx.openLocation({
          latitude: latitude,
          longitude: longitude,
          scale: 28,
          name: '观合中医',
          address: '春熙路店铺',
          success: res => {
            console.log(res)
          }
        })
      }
    })
  }

报的错误:

网址为 qqmap://map/nearby?coord=30.64242,104.04311&placeName=观合中医 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。

ERR_UNKNOWN_URL_SCHEME

请问怎么解决这个问题?

4 回复

这是在开发工具中调试出现的,发布到真机上是可以的。

我也遇到这个问题。求指点!搞了好长时间了

你好,这个是打开的网站出现了问题,你可以去查下这个网页还能不能正常使用

开发者工具中跳转webview也出现同样的问题,手机测试则可以打开webview的页面。

回到顶部