3

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!

mindbomb
  • 1,642
  • 4
  • 20
  • 35

1 Answers1

2

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?

Community
  • 1
  • 1
Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
  • Very, VERY interesting solution.. Gonna try messing around with this idea, I'll let you know how it went. Thank you!! – mindbomb Aug 04 '15 at 23:56
  • DID IT!! The KML-iOS lib in the link was all broken, I had to defer to Apple's KMLParser example which was iOS 4 code, so had to ARCify it and then I could load all the placemarks by converting the Apple's MKAnnontation array to Google's GMSMarkers, but after some extensive tweaking it finally worked nicely and I have all the data on the map. Thanks!! if anyone wants some code snippets let me know. – mindbomb Aug 05 '15 at 19:30
  • @mindbomb please can you provide me that code snippets. see my question http://stackoverflow.com/questions/41262736/how-to-load-kml-file-into-google-maps-ios-sdk – Mitesh Dobareeya Dec 22 '16 at 06:24