"The maximum number of texture atlases has been reached, cannot select more" using Google Maps

I am creating an application that uses Google Maps, and a lot of overlays, it seems that when I try to load a lot of overlays, it stops and gives me "((null)), it was false: The maximum number of texture atlases was reached, cannot select more."

I just add the images as overlays like this:

...
if (image != nil) {
                let image: CGImage = (image?.cgImage)!
                let icon = UIImage(cgImage: image)

                let overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)
                overlay.bearing = 0
                overlay.map = map
                overlay.zIndex = 10

                self.overlays.append(overlay);

Any suggestions to fix this problem?

+4
source share
2 answers

Try

if let image = image {
    let overlay = GMSGroundOverlay(bounds: overlayBounds, icon: icon)
    overlay.bearing = 0
    overlay.map = map
    overlay.zIndex = 10

    self.overlays.append(overlay)
}
+2
source

, UIImage /. , GMSMapView, UIImage.

, UIImage . .

, . ? , .

0

Source: https://habr.com/ru/post/1674891/


All Articles