Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 谷歌地图swift 5上无法使用geojson显示标记标题_Ios_Swift_Google Maps_Google Maps Markers - Fatal编程技术网

Ios 谷歌地图swift 5上无法使用geojson显示标记标题

Ios 谷歌地图swift 5上无法使用geojson显示标记标题,ios,swift,google-maps,google-maps-markers,Ios,Swift,Google Maps,Google Maps Markers,我正在尝试将geojson文件中的数据显示到google地图。 我有显示行,但我不能在谷歌地图上显示数据标题 下面是geojson文件中json的简单示例 { “类型”:“FeatureCollection”, “名称”:“导出输出2”, “crs”:{ “类型”:“名称”, “财产”:{ “名称”:“urn:ogc:def:crs:ogc:1.3:CRS84” } }, “特点”:[{ “类型”:“功能”, “财产”:{ “名称”:“名称”, “描述”:空, “altitudeMode”:“c

我正在尝试将geojson文件中的数据显示到google地图。 我有显示行,但我不能在谷歌地图上显示数据标题

下面是geojson文件中json的简单示例

{ “类型”:“FeatureCollection”, “名称”:“导出输出2”, “crs”:{ “类型”:“名称”, “财产”:{ “名称”:“urn:ogc:def:crs:ogc:1.3:CRS84” } }, “特点”:[{ “类型”:“功能”, “财产”:{ “名称”:“名称”, “描述”:空, “altitudeMode”:“clampToGround”, “备注”:“备注”, “FID”:“1”, “字段1”:“字段1” }, “几何学”:{ “类型”:“多多边形”, “坐标”:[ [ [ [50.016116765605382, 26.55069039986865], [50.015975528609339, 26.550991875762669], [50.015543249856229, 26.552092609191], [50.014021356227893, 26.555916886985312], [50.013986819836397, 26.555993389005849], [50.0139615327519, 26.55605189831601], [50.013937500451902, 26.556110416304062], [50.013914703626462, 26.556171199925231], [50.013893190939172, 26.556229735340509], [50.013872592497187, 26.55629053416698], [50.013853248846132, 26.556351341673729], [50.013834177740307, 26.5564166652394], [50.010366238955562, 26.55583737812676], [50.010393511923603, 26.555767597848071], [50.010456762048257, 26.555598755587489], [50.010516559775482, 26.555429888414469], [50.010573224326002, 26.555261000355909], [50.010626464910303, 26.555089831406779], [50.010676553278628, 26.554918640545011], [50.011099741935944, 26.553458982554702], [50.011300373154121, 26.552817103722361], [50.011331824976743, 26.55269769626123], [50.011356070762062, 26.552614352208838], [50.011381863106351, 26.55253327596817], [50.011409240723651, 26.552449953630379], [50.011438194289781, 26.552366642218029], [50.01146869440673, 26.552285598614549], [50.011501071619158, 26.55220456712059], [50.01153470354334, 26.552123545223392], [50.011569892050197, 26.552044791201482], [50.011606655769612, 26.551963791005878], [50.011644976066812, 26.551885058683109], [50.011684872292918, 26.55180633727754], [50.01172630602143, 26.55172988360998], [50.012049918940242, 26.551135195177299], [50.012152127902489, 26.550947367255439], [50.013113094152381, 26.549252177776619], [50.016116765605382, 26.55069039986865] ] ] ] }
}]}

我不熟悉这个主题,但是如果您从geojson文件中添加一些示例数据,这会很有帮助。祝你好运@我已经编辑了这个问题。提前谢谢
 let path = Bundle.main.path(forResource: "dat", ofType: ".geojson")
        let url = URL(fileURLWithPath: path!)
        geoJsonParser = GMUGeoJSONParser(url: url)
        geoJsonParser.parse()
        renderer = GMUGeometryRenderer(map: mapKitC, geometries: geoJsonParser.features)
        for i in geoJsonParser.features {
            if let feature = i as? GMUFeature {
                let properties = feature.properties
                //print(properties?["Name"]! ?? [String:AnyObject]())
                print((properties?["Name"] as! String))
                i.style = GMUStyle(styleID: "feat_1", stroke: UIColor.red, fill: .clear, width: 2, scale: 1, heading: 1, anchor: CGPoint.zero, iconUrl: nil, title: (properties?["Name"] as! String) , hasFill: true, hasStroke: true)
            }
        }