Post

Replies

Boosts

Views

Activity

Show .KMZ file on Google Map in IOS Swift
I am able to load KML on Google map with below code. But now I want to show .KMZ file on Google map. I did unarchived it & added Folder containing doc.kml & Files folder which comntains 1 image, & tried to show doc.kml file on Google map.But didn't succeeded. func showKMLFile(kmlfileurl:URL) { print("fileURL in show is \(kmlfileurl)") var renderer: GMUGeometryRenderer! var kmlParser: GMUKMLParser! if self.mapView != nil { kmlParser = GMUKMLParser(url:kmlfileurl) kmlParser.parse() renderer = GMUGeometryRenderer(map: self.mapView, geometries: kmlParser.placemarks, styles: kmlParser.styles) renderer.render() } } & I am calling this function like let fileManager = FileManager.default do { let docsArray = try fileManager.contentsOfDirectory(atPath: docsPath) print("docarray is \(docsArray)") for obj in docsArray{ if obj == "doc.kml" { self.showKMLFile(kmlfileurl: URL(fileURLWithPath: docsPath + "/" + "FAIRMEAD LF" + "/" + obj)) } } } catch { print(error) }
0
0
1.4k
Jan ’22
Goggle map crashed after drawing more than 1300 markers with custom color
I can draw more than around 8000 default red markers without setting icon property for marker. But I want to draw markers with different colors depending upon marker's value. In XCOde I get below warning:- "((null)) was false: Reached the max number of texture atlases, can not allocate more.  ((null)) was false: Failed to get the icon for the given CGImageRef. ((null)) was false: Failed to allocate texture space for marker"  from Google Map SDK & after that around 1300 markers it gets crashed. Is there any other way to set different colors to markers without crashing for more than 1300 markers. I am setting marker's colour like below:- marker.icon = GMSMarker.markerImage(with: self.getColorsFromString(strColor: strColor)) func getColorsFromString(strColor:String) -> UIColor { var color = UIColor() switch strColor { case "GREEN": color = UIColor.green case "YELLOW": color = UIColor.yellow case "RED": color = UIColor.red case "ORANGE": color = UIColor.orange case "BLUE": color = UIColor.blue case "CYAN": color = UIColor.cyan case "MAGENTA": color = UIColor.magenta default: color = UIColor.red print("default color") } return color }
1
0
1.5k
Nov ’21
Show .KMZ file on Google Map in IOS Swift
I am able to load KML on Google map with below code. But now I want to show .KMZ file on Google map. I did unarchived it & added Folder containing doc.kml & Files folder which comntains 1 image, & tried to show doc.kml file on Google map.But didn't succeeded. func showKMLFile(kmlfileurl:URL) { print("fileURL in show is \(kmlfileurl)") var renderer: GMUGeometryRenderer! var kmlParser: GMUKMLParser! if self.mapView != nil { kmlParser = GMUKMLParser(url:kmlfileurl) kmlParser.parse() renderer = GMUGeometryRenderer(map: self.mapView, geometries: kmlParser.placemarks, styles: kmlParser.styles) renderer.render() } } & I am calling this function like let fileManager = FileManager.default do { let docsArray = try fileManager.contentsOfDirectory(atPath: docsPath) print("docarray is \(docsArray)") for obj in docsArray{ if obj == "doc.kml" { self.showKMLFile(kmlfileurl: URL(fileURLWithPath: docsPath + "/" + "FAIRMEAD LF" + "/" + obj)) } } } catch { print(error) }
Replies
0
Boosts
0
Views
1.4k
Activity
Jan ’22
Goggle map crashed after drawing more than 1300 markers with custom color
I can draw more than around 8000 default red markers without setting icon property for marker. But I want to draw markers with different colors depending upon marker's value. In XCOde I get below warning:- "((null)) was false: Reached the max number of texture atlases, can not allocate more.  ((null)) was false: Failed to get the icon for the given CGImageRef. ((null)) was false: Failed to allocate texture space for marker"  from Google Map SDK & after that around 1300 markers it gets crashed. Is there any other way to set different colors to markers without crashing for more than 1300 markers. I am setting marker's colour like below:- marker.icon = GMSMarker.markerImage(with: self.getColorsFromString(strColor: strColor)) func getColorsFromString(strColor:String) -> UIColor { var color = UIColor() switch strColor { case "GREEN": color = UIColor.green case "YELLOW": color = UIColor.yellow case "RED": color = UIColor.red case "ORANGE": color = UIColor.orange case "BLUE": color = UIColor.blue case "CYAN": color = UIColor.cyan case "MAGENTA": color = UIColor.magenta default: color = UIColor.red print("default color") } return color }
Replies
1
Boosts
0
Views
1.5k
Activity
Nov ’21