Currently my app uses google api v2 maps for iOS. I would like to add custom tile overlays, which, as I understand it, api does not support.
The first approach I took to this problem was to try to extend the GMSOverlay class, but later I discovered that the drawLayer method was never called.
Then I tried to have my custom class extend UIView , and then add my class as a subview to the map view. I managed to use the GMSMapViewDelegate didChangeCameraPosition method to report camera news back to my custom class so that the tiles could be redrawn. This mainly worked with a few exceptions: first, only the initial set of tiles was loaded, and if you zoomed in or out from the initial X, Y, Z, then the map tiles will not be updated using the drawInRect method. The second problem was that my custom UIView covered all the markers and their respective callouts after clicking.
My question is: does anyone have experience adding custom fragments or subclassing the GMSOverlay class to add, for example, custom weather tiles on top of a google map?
source share