I am using the Google Maps API in my iOS application. At the end of a session the map zooms out and captures a screenshot. Unfortunately at the moment, often the map doesn't have time to load all the tiles exposed by the zoom before taking the screenshot.
I see that Apple's MKMapView has an mapViewDidFinishLoadingMap
delegate. Is there something similar provided in the Google API?
maps) {...} will give you a reference error if google is undefined (i.e. if the API didn't load). Instead, use if (typeof google === 'object' && typeof google. maps === 'object') {...} to check if it loaded successfully.
Note that by dividing the pixel coordinates by the tile size (256) and taking the integer parts of the result, you produce as a by-product the tile coordinate at the current zoom level.
A map load occurs whenever a Mapbox GL JS Map object is initialized on a webpage. This means that people who are using your web map can toggle additional sources on and off, interact with the map, and toggle between styles without affecting your usage.
You can add important places by searching for locations or drawing them directly on the map.
The Google Maps SDK for iOS has a method called mapViewDidFinishTileRendering that is called when the map finishes rendering.
-(void)mapViewDidFinishTileRendering:(GMSMapView *)mapView{
//TAKE THE SCREENSHOT HERE
}
Also, don't forget to set the delegate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With