Search code examples
iosobjective-cgoogle-mapsgoogle-maps-markersgoogle-maps-sdk-ios

Displaying "my map" layers in Google maps for iOS SDK


Is there a way to display (and search in markers data) "my maps" layer in a GMSMapView in the Google maps SDK for iOS? Searched docs but couldn't find.

"my maps" are basically custom maps with additional layers you can create on top of a google map region, I want to use a public one that has tons of layers and markers already in place (I do not want recreate them programmatically).

basic example for "my maps" data: https://www.google.com/maps/d/viewer?mid=zRF3RCwWPTMg.k8Zh-QyncJYc

thanks!


Solution

  • Unfortunately it looks like there is no API for accessing My Maps, see here:

    Google maps API - get my custom map

    However, it looks like it's possible to convert your My Map into KML, either a one-time download or a live link to the current map content, see here:

    https://support.google.com/mymaps/answer/3109452?hl=en

    (I found this via Add Google "My Maps" Layer to Google Maps Javascript API, although the UI to get the KML has since changed from that answer in 2009).

    Once you have the KML you can't add it directly to your map, but you can parse it and then add each of the markers etc, see here:

    How to load a KML file URL into Google Maps using iOS API?