收藏
回答

wx.canIUse() for mapContext's getRegion?

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?

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

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
    有用
    回复
  • ㅤㅤㅤㅤ
    ㅤㅤㅤㅤ
    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
    有用
    回复
登录 后发表内容