map插件的circles问题

walkeeper 2018-02-27 05:44:24
领导要求做个地图功能,做3个圆圈 3k,5k,10k的范围,我现在用controls里放了3个数字图片,然后点击图片的事件里希望能调整圆圈的radius。点了以后在console监控属性,radius的数值是改变了, 但是地图上的圆圈就消失了,请问大大们应该怎么做呢?
附上部分代码如下

//onload中的circles设置
wx.getLocation({
type: "wgs84",
success: function (res) {
_this.setData({
latitude: res.latitude,
longtitude: res.longitude,
circles:[{
latitude: res.latitude,
longitude: res.longitude,
color: '#FF0000DD',
fillColor: '#7cb5ec88',
radius: 3000,
strokeWidth: 1
}]

//controlTap中的代码
controltap(e){
var that = this;

if (e.controlId == 3){
that.setData({
circles: [{
latitude: 121.400420,
longitude: 31.171760,
color: '#FF0000DD',
fillColor: '#7cb5ec88',
radius: 7000,
strokeWidth: 1
}]
})
}

...全文
569 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
walkeeper 2018-03-05
  • 打赏
  • 举报
回复
自己解决了……貌似是自带的map功能不能重新渲染circles,只能传递参数在页面加载的时候重新设置圆圈大小,所以做个 wx.redirectTo({ url: '/pages/map_test/map_test?radius=' + radius + '&lng=' + res.longitude + '&lat=' + res.latitude }) 重新跳转到本页面实现改变圆圈的大小
walkeeper 2018-02-28
  • 打赏
  • 举报
回复
自顶……求大大们帮助啊
Nex slider 是一款快速全屏的滑动模块, 它通过不引入任何的场景插件,以获得最优的性能。它兼容不同的平台;也允许用户嵌入图片、视频、甚至是 Google 地图。功能特性:Customizable slider lookOptimized SpeedTouch SupportKeyboard SupportPattern SupportSEO Friendly10 types of effects: Fade, Slide [left,right,top,bottom], Zoom, Skew, Rotate, Random, None5 Predifined Color themes: amethyst, coral, sun, turquoise, and the default oneSupport of image filters: brightness,contrast,grayscale,hue-rotate,saturate,sepia.Different Content types: image, video, mapCustomizeable map style: ROADMAP, SATELLITE, HYBRID, TERRAINCustomizable maps: zoom size, show infowindow, or hide itVideo Support from youtube and vimeo2 types of thumbnails: circles and squaresCompatible Browsers: Firefox, Chrome, Safari, IE9-IE11 分享 window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": [], "bdPic": "", "bdStyle": "1", "bdSize": "24" }, "share": {} }; with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' ~(-new Date() / 36e5)];\r\n \r\n \r\n \r\n \r\n \u8f6f\u4ef6\u9996\u9875\r\n \u8f6f\u4ef6\u4e0b\u8f7d\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\nwindow.changyan.api.config({\r\nappid: 'cysXjLKDf', conf: 'prod_33c27aefa42004c9b2c12a759c851039' });

3,143

社区成员

发帖
与我相关
我的任务
社区描述
微信开发即微信公众平台开发,将企业信息、服务、活动等内容通过微信网页的方式进行表现,通过二次开发可以将公众账号由一个媒体型营销工具转化成提供服务的产品。
社区管理员
  • 微信开发
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧