circle.setMap(null)不起作用

时间:2018-08-29 14:17:49

标签: javascript google-maps

我已经使用google maps api绘制了圆圈,我想从地图上删除圆圈,circle.setMap(null);无效。

var circleDetails = {
    strokeColor: "#c4c4c4",
    strokeOpacity: 0.35,
    strokeWeight: 0,
    fillColor: "#ffffff",
    fillOpacity: 0.35,
    map: this.map,
    center: latlng,
    radius: this.fenceData[i].radius,
  };
  var removeCircle = new google.maps.Circle(circleDetails);
  removeCircle.setMap(null);

0 个答案:

没有答案