- 小程序有两个mapContext实例,先创建的实例API不执行
小程序有两个页面 index 和adv ,每个页面都使用了map组件,并且在onLoad函数里创建了mapContext, index.wxml <map id="qqMap" style="width: 100%; height: {{screenHeightMap}}px;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" bindmarkertap="showTipWin" bindtap="closeTipWin" bindregionchange="regionchange" bindcallouttap="btnCallout" show-location> index.js onLoad: function (option) { this.mapCtx = wx.createMapContext('qqMap'); }, adv.wxml <map id="advMap"style="width: 100%; height: 190px;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" show-location circles="{{circles}}" bindtap="ontapstart" bindregionchange="regionchange"> adv.js onLoad: function (options) { this.mapCtxAdv = wx.createMapContext('advMap'); }, 微信小程序开发工具,基础库 2.3.0 编译完成后,首先进入的是index 页面,此时mapCtx下的所有API函数都正常,当跳转到adv页面后,再跳转回到index页面,则mapCtx下的所有API都不执行了 有哪位大神遇到过这种情况,求大神帮忙,非常感谢
2019-05-12 - 获取小程序带参数二维码却返回了一个奇怪的链接,求帮助,谢谢
小程序还在开发阶段,java后台获取小程序带参数的二维码,使用的是官网提供的B接口,http协议返回code是200表示访问成功,但是inputStream流里读出的不是二维码的二进制流,而是一个奇怪的链接,求大神帮忙看看,什么原因,非常感谢 下面是eclipse控制台console 打印的信息: inputsstream==sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@75b58d60 代码片段如下: int responseCode = httpURLConnection.getResponseCode();//获取返回状态码 /*返回码只有是200才表示一切正常,返回成功,其他码值都是有问题的*/ if (responseCode == 200) { // 从服务器获得一个输入流 byte[] buf = new byte[1024]; int size = 0; bis = new BufferedInputStream(httpURLConnection.getInputStream()); System.out.println("inputsstream==" + httpURLConnection.getInputStream()); fos = new FileOutputStream(new File(filePath)); while ((size = bis.read(buf)) != -1) { fos.write(buf, 0, size); //fos.flush(); } fos.flush(); fos.close(); bis.close(); }
2019-04-14