在GMSMapView上添加多个标记

时间:2015-07-04 10:22:14

标签: ios swift google-maps gmsmapview

我是谷歌地图新手,我想向GMSMapView和infoWindow添加多个标记。

我的代码

   for Prop: Property in properties
    {
        var latStr = Prop.lat as NSString
        var latDbl : Double  = Double(latStr.intValue)
        var langStr = Prop.lang as NSString
        var langDbl : Double = Double(langStr.intValue)

        var marker = GMSMarker()
        marker.position = CLLocationCoordinate2DMake(latDbl,langDbl )
        println(marker.position)
        marker.flat = true
        marker.title = Prop.buildingName as String
        marker.snippet = Prop.address as String
        marker.infoWindowAnchor = CGPointMake(0.5, 0.5)
        marker.map = googleMapView

    }

 googleMapView.delegate = self

有人可以让我知道我做错了什么或有人可以编辑我的代码并告诉我正确的方法吗?

0 个答案:

没有答案