微信公开课
微信公开课小程序热门讨论关于「小程序markers图标不显示啊」的小程序开发问题
补充:小程序markers图标不显示啊,varBmob=require(utilsbmobjs);
展开:varBmob=require(utilsbmobjs);varapp=getApp();Page({data:{longitude:,latitude:,markers:[],controls:[{iconPath:imagesaddresspng,position:{left:(appglobalDatawindowWidth2)20,top:(appglobalDatawindowHeight40)238,width:40,height:40}},{id:1,iconPath:imagespositioningpng,position:{left:20,top:20,width:40,height:40},clickable:true}]},staticData:{},onShow(){thisgetLocation();},onReady:function(e){varthat=this;thismapCtx=wxcreateMapContext(Map);constquery=BmobQuery(customerInfo);queryfind()then(res={consolelog(res)for(vari=0;i<reslength;i++){thatsetData({markers:{id:i,iconPath:imagesbuypng,latitude:res[i]latitude,longitude:res[i]longitude,width:50,height:50}})consolelog(thatdatamarkers)}});图片上是markers的值,但是为啥markers不显示即速小程序:thatsetData({markers:[{id:i,iconPath:imagesbuypng,latitude:res[i]latitude,longitude:res[i]longitude,width:50,height:50}]}):我知道应该这样写,但是我想在markers加入多个对象,所以用for循环生成多个对象:那你应该push:push是什么,求教,谢谢:letmarkers=[]for(vari=0;i<reslength;i++){letmarker={id:i,iconPath:imagesbuypng,latitude:res[i]latitude,longitude:res[i]longitude,width:50,height:50}markerspush(marker)}thatsetData({markers:markers}):谢谢,你等我试验一下:哈哈哈我才不等你哦睡觉啦:谢谢啦,老乡:可以用了:额这么快试好啦晚安成都:晚安,赣州:霄神,哪个帖子都有你展开:_展开::能回答的就插一脚咯~
更多有关「小程序markers图标不显示啊」的讨论可以前往微信公开课小程序参与互动哦!了解更多
方法1:微信扫描微信公开课小程序码即可订阅热门讨论「小程序markers图标不显示啊」
方法2:微信搜索微信公开课小程序名称进入,即可订阅热门讨论「小程序markers图标不显示啊」
方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热门讨论「小程序markers图标不显示啊」
微信公开课小程序热门讨论「小程序markers图标不显示啊」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。
微信公开课热门讨论「小程序markers图标不显示啊」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。