从Google地图中删除圈子 [英] Remove circles from Google map

查看:113
本文介绍了从Google地图中删除圈子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i想要移除第一个绘制的圆圈,并在地图上添加一个新半径的新圆圈。

我是怎么做到的?



我尝试了什么:



  var  circle =  new  google.maps.Circle({
strokeWeight: 1 0
fillOpacity: 0 1
});
circle.setMap( null );

var radus = 300 ;
var sel_rads = $(' #mapradius选项:选择了)VAL();
if (sel_rads!= 0 ){
radus = sel_rads * 100 ;
}
var cityCircle = new google.maps.Circle({
strokeColor:' #000'
strokeOpacity: 0 8
strokeWeight: 2
fillColor:' #000'
fillOpacity: 0 05
半径:radus,
map:map,
center:map.center
});

set ' distance',opt_distance);
set ' active' false );
this .bindTo(' bounds',circle);

circle.bindTo(' center');
circle.bindTo(' zIndex');
circle.bindTo(' map');
circle.bindTo(' strokeColor');
circle.bindTo(' radius');

解决方案

' #mapradius选项:选中')。val();
if (sel_rads!= 0 ){
radus = sel_rads * 100 ;
}
var cityCircle = new google.maps.Circle({
strokeColor:' #000'
strokeOpacity: 0 8
strokeWeight: 2
fillColor:' #000'
fillOpacity: 0 05
半径:radus,
map:map,
center:map.center
});

set ' distance',opt_distance);
set ' active' false );
this .bindTo(' bounds',circle);

circle.bindTo(' center');
circle.bindTo(' zIndex');
circle.bindTo(' map');
circle.bindTo(' strokeColor');
circle.bindTo(' radius'这个);


这是我的解决方案

 distanceWidget.set(< span class =code-string>'  map' null ); 

和distanceWidget是:
distanceWidget = new DistanceWidget({
map:map,
距离: rads, // 以km为单位的起始距离。
maxDistance: 0 5 // Twitter的最大距离为2500km。
color:' #000000'
activeColor:' #5599bb'
sizerIcon:' ../ Contents / Images / resize-off.png'
activeSizerIcon:' ../ Contents / Images / resize.png'
});


Hi,
i want to remove first drawn circle and add a new circle with new radius on map.
how i do this?

What I have tried:

var circle = new google.maps.Circle({
    strokeWeight: 1.0,
    fillOpacity: 0.1
  });
  circle.setMap(null);
  
  var radus = 300;
  var sel_rads = $('#mapradius option:selected').val();
  if (sel_rads != "0") {     
      radus = sel_rads * 100;
  }  
  var cityCircle = new google.maps.Circle({
      strokeColor: '#000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: '#000',
      fillOpacity: 0.05,
      radius: radus,
      map: map,
      center: map.center
  });

  this.set('distance', opt_distance);
  this.set('active', false);
  this.bindTo('bounds', circle);

  circle.bindTo('center', this);
  circle.bindTo('zIndex', this);
  circle.bindTo('map', this);
  circle.bindTo('strokeColor', this);
  circle.bindTo('radius', this);

解决方案

('#mapradius option:selected').val(); if (sel_rads != "0") { radus = sel_rads * 100; } var cityCircle = new google.maps.Circle({ strokeColor: '#000', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#000', fillOpacity: 0.05, radius: radus, map: map, center: map.center }); this.set('distance', opt_distance); this.set('active', false); this.bindTo('bounds', circle); circle.bindTo('center', this); circle.bindTo('zIndex', this); circle.bindTo('map', this); circle.bindTo('strokeColor', this); circle.bindTo('radius', this);


here is my solution

   distanceWidget.set('map', null);

and distanceWidget is:
 distanceWidget = new DistanceWidget({
                map: map,
                distance: rads, // Starting distance in km.
                maxDistance: 0.5, // Twitter has a max distance of 2500km.
                color: '#000000',
                activeColor: '#5599bb',
                sizerIcon: '../Contents/Images/resize-off.png',
                activeSizerIcon: '../Contents/Images/resize.png'
            });


这篇关于从Google地图中删除圈子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆