小程序
小游戏
企业微信
微信支付
扫描小程序码分享
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 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
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.
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
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}
var context = wx.createMapContext(mapId);
if (context.getRegion) {
// supported
} else {
// not supported
}
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
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.
u should invoke `wx.createMapContext()` to get a MapContext object, then use `if`.
suck as: