mapCtx 下面方法无法调用
发布于 5 年前 作者 ewan 9772 次浏览 来自 问答

在开发者工具上能没有问题,在手机上无法执行mapCtx下面的方法,换了几个基础库都不行!(上个月能用,最近没做更改突然就挂掉了)

定义

Page({

mapCtx: wx.createMapContext(‘navi_map’),

regionchange: function (e) {

   var that = this;

   console.log(that.mapCtx)

   that.mapCtx.getScale({

     success: function (res) {

       wx.showModal({

         title: ‘提示’,

         content: JSON.stringify(res.scale),

         cancelText: ‘确定’,

         confirmText: ‘取消’,

         success: function (res) {

           // that.mapCtx.moveToLocation();

         }

       })

     }

   })

开发工具上执行结果没有问题

ios手机执行结果:

回到顶部