想实现流浪猫在校园里的位置上报,在地图上显示流浪猫的出现过的位置,但我只能显示一只猫的位置上传与显示,
data: {
marks:[
{
id:0,
latitude:23.56789,
longitude:113.2157,
title:"喵~",
iconPath:"../../images/猫咪.png",
width:30,
height:30
},
{
id:1,
latitude:23.56792,
longitude:113.2137,
title:"喵~",
iconPath:"../../images/猫咪.png",
width:30,
height:30
},
]
},
//获取当前位置
getLocation:function(){
wx.getLocation({
success:function(res){
console.log(res);
}
})
},
无法实现多只猫的由用户自行增加与减少
用户控制你需要使用wx.request等网络对象获取服务器的数据,
看文档 基础差也没关系 照猫画虎 没有服务器就采取云开发