是否可以在Google Map API上添加类似于MapKit中的MKOverlay的叠加层?

时间:2012-12-14 22:32:01

标签: ios iphone google-maps google-maps-sdk-ios google-maps-mobile

我们正在尝试使用适用于iOS的新版谷歌地图API,我们需要能够添加类似于MKOverlay在Apple的MapKit中所做的叠加。

1 个答案:

答案 0 :(得分:0)

      let poly = GMSMutablePath()

    poly .addCoordinate(CLLocationCoordinate2DMake(newLocation.coordinate.latitude, newLocation.coordinate.longitude))

    let polygon = GMSPolygon()
        polygon .path = poly
    polygon.fillColor = UIColor.greenColor()

    polygon.strokeWidth = 4
     polygon.strokeColor = UIColor .redColor()
    polygon.map = self.mapView