在我的rails应用程序中,我正在使用1.5.6版本的gmaps4rails gem。我想通过ajax更新我的地图圈子属性
任何人都可以建议我这样做吗?
答案 0 :(得分:1)
首先,获取您的圈子,应该在Gmaps.map.circles
然后:
circle.serviceObject.setRadius(number)
答案 1 :(得分:1)
在ajax的成功功能中,您可以这样编码:
Gmaps.loadMaps()
// if you are using markers
markers_json = JSON.parse(markers)
Gmaps.map.replaceMarkers(markers_json)
// if you are using circle
Gmaps.map.clear_circles()
circle_json = JSON.parse(circle)
Gmaps.map.circles = circle_json
Gmaps.map.create_circles()
由于