Я пытаюсь отобразить данные из файла geo json на картах Google. у меня были строки отображения, но я не мог отобразить заголовок данных в google Вот то, что я получил пути только без заголовков map
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)
}
}
вот простой json в гео json file
{"type": "FeatureCollection", "name": "Export_Output_2", "crs": {"type": "name", "properties": {"name": "urn: og c: def: crs: OG C: 1.3: CRS84 "}}," features ": [{" type ":" Feature "," properties ": {" Name ":" الجزيرة "," description ": null," altitudeMode ":" fixToGround "," REMARKS ":" الجزيرة "," FID ":" 1 "," Field_1 ":" الجزيرة "}," geometry ": {" type ":" MultiPolygon ", "координаты": [[[[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.01387259249718 7, +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.01611676560538]] 266 868] 68], 26688686, № 26, 26, 8, 29, 28, 26, 29, 28, 29, 8, 29, 29, 8), 26, 29, 28, 29, 28, 26, 29, 8, 29), 26, 8, 26, ПН, 26, 50].