收藏
回答

为什么H5调用了wx.openLocation()无法调起内置地图?

 wx.openLocation({

        latitude: parsefloat(23.142724), // 纬度,浮点数,范围为90 ~ -90

        longitude: parsefloat(113.29132), // 经度,浮点数,范围为180 ~ -180。

        name: "好世界广场", // 位置名

        address: "广州市越秀区环市东路362-366号", // 地址详情说明

        scale: 16, // 地图缩放级别,整形值,范围从1~28。默认为最大

        success: function (res) {

          console.log(res);

        },

        fail: function (res) {

          console.log(res);

        },

      });

最后出现openLocation:permission denied"

回答关注问题邀请回答
收藏

2 个回答

  • จุ๊บ
    จุ๊บ
    2020-12-28

    贴下代码,看下你config 怎么写的

    2020-12-28
    有用
    回复 6
    • lin
      lin
      2020-12-28
      this.$api
              .share({
                url: url,
              })
              .then(
                (res) => {
                  wx.config({
                    appId: res.appId,
                    timestamp: res.timestamp,
                    nonceStr: res.nonceStr,
                    signature: res.signature,
                    jsApiList: ["openLocation", "getLocation"],
                  });
                },
                (error) => {
                  console.log(error);
                }
              );
      2020-12-28
      回复
    • จุ๊บ
      จุ๊บ
      2020-12-28回复lin
      开发工具上没有任何报错?
      2020-12-28
      回复
    • lin
      lin
      2020-12-28回复จุ๊บ
      调用openLocation()接口报openLocation:fail, the permission value is offline verifying
      2020-12-28
      回复
    • จุ๊บ
      จุ๊บ
      2020-12-28回复lin
      个人实测是没问题的
      2020-12-28
      回复
    • 是个小麻烦鬼
      是个小麻烦鬼
      2021-08-03回复จุ๊บ
      请问下调用openLocation接口报错Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.r?是什么原因
      2021-08-03
      回复
    查看更多(1)
  • Galina
    Galina
    2020-12-28

    我记得是h5引用了js-sdk需要调用config接口注入权限验证配置。


    2020-12-28
    有用
    回复 2
    • lin
      lin
      2020-12-28
      jsApiList: [openLocation;getLocation],已经添加了
      2020-12-28
      回复
    • nomo
      nomo
      2022-01-13回复lin
      有解决吗
      2022-01-13
      回复
登录 后发表内容
问题标签