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
}