收藏
回答

wx.canIUse() for mapContext's getRegion?

问题模块
API和组件

I cannot use wx.canIUse('createMapContext.return.getRegion') in which it always return false. It should return true as I tested with SDKVersion > 1.4.0.


Is this a bug? or I use it wrong?

最后一次编辑于  2017-09-29  (未经腾讯允许,不得转载)
回答关注问题邀请回答
收藏

2 个回答

  • Wasin
    Wasin
    2017-09-29

    Thank you. It's also good alternative way, I took note of it.


    I just found out that it works if I use

    wx.canIUse('mapContext.getRegion')


    Problem solved now.

    2017-09-29
    赞同
    回复
  • Mr. ♥
    Mr. ♥
    2017-09-29

    u should invoke `wx.createMapContext()` to get a MapContext object, then use `if`.


    suck as:

    var context = wx.createMapContext(mapId);

    if (context.getRegion) {

      // supported

    } else {

      // not supported

    }

    2017-09-29
    赞同
    回复