2017-07-04 119 views

回答

1

直接在圈是不可能

你可以基于圈

var myCicle = new google.maps.Polyline({ 
       path: drawCircle(new google.maps.LatLng(46.0,11.0), 50, 1), 
       strokeOpacity: 0, 
       icons: [{ 
       icon: lineSymbol, 
       offset: '0', 
       repeat: '15px' 
       }], 
       strokeWeight: 1, 
       fillColor: "#FFFF00", 
       fillOpacity: 0.15, 
       map:map 
    }); 
0

随着GMSCircle其不可能的,你必须提请根据折线绘制折线圈。

使用GMSGeometryOffset,您可以为您的位置生成偏移量。 360/6 = 60表示效率较低的细节。

let path = GMSMutablePath() 

for i in 0...60 { 
    let offsetLocation = GMSGeometryOffset(location.coordinate, circleRadius, CLLocationDirection(i*6)) 
    path.add(offsetLocation) 
} 
let length: [NSNumber] = [10, 10] 
let circle = GMSPolyline(path: path) 
let styles = [GMSStrokeStyle.solidColor(.clear), GMSStrokeStyle.solidColor(.red)] 

circle.spans = GMSStyleSpans(circle.path!, styles, length, GMSLengthKind.rhumb) 
circle.strokeWidth = 1.0 
circle.map = mapView 
+0

请详细说明您的答案。 – UmarZaii