Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Google Maps Api Tiled Overlays

My app currently is using the google maps api v2 for iOS. I would like to add custom tiled overlays, which I realize is not support by the api.

The first approach I took to this problem was to try to extend the GMSOverlay class but I later found that the drawLayer method was never being called.

Next, I tried having my custom class extend UIView and then add my class as a subview to the map view. I was able to use the GMSMapViewDelegate method didChangeCameraPosition to report camera updates back to my custom class so that the tiles could be redrawn. This mostly worked with a couple exceptions, first, only the initial set of tiles would load, and if you panned or zoomed from the initial X,Y,Z the map tiles would not update via the drawInRect method. The second problem was that my custom UIView was covering all the markers and their corresponding callouts after tapping.

My question is, does anyone having any experience adding custom tiles or subclassing the GMSOverlay class to add, for example, custom weather tiles over top of the google map?

like image 867
Jeffrey Kuntz Avatar asked May 03 '13 21:05

Jeffrey Kuntz


People also ask

Can you create overlays in Google Maps?

Use map images to create extra information without embedding it into your original map. To see how an overlay image corresponds to the map image underneath it: Select the overlay in the viewer. Then, change the transparency so that it's fully opaque.

What is tile overlay Google Maps?

Select platform: Android iOS JavaScript. A tile overlay, sometimes called a tile layer, is a collection of images that are displayed on top of the base map tiles.

Can you customize Google Maps API?

Google Maps Platform offers Cloud-based maps styling features that make it easy to style, customize, and manage your maps using the Google Cloud Console, letting you create a customized map experience for your users without having to update your apps' code each time you make a style change.

What is a map tile layer?

A raster tile layer is composed of cached raster tiles, also called map tile caches. These are delivered to client applications as image files (for example, JPG or PNG format) that have been prerendered and stored in ArcGIS Online. The tiles are statically displayed by the client.


1 Answers

Good news from the release notes of v. 1.3.0 of Google Maps SDK for iOS (released today):

Support for custom tile overlays (image-based) via GMSTileLayer.

See: https://developers.google.com/maps/documentation/ios/releases

like image 83
Magnus Avatar answered Oct 05 '22 04:10

Magnus