1

I am using Google Maps SDK in my iOS project. I am using Swift and I want to display the Google Map in UIView without any text or labels. I am able to display the map correctly but I am not able to remove the text from the map... I saw the same problem in Javascript but was unable to replicate it in Swift (How to get a map without labels?)... I want the regular type of the map (kGMSTypeNormal). Is there some way how to do it?

Community
  • 1
  • 1
Mazel Tov
  • 2,064
  • 14
  • 26
  • Have you seen this question: http://stackoverflow.com/questions/24431602/how-to-hide-default-labels-on-google-maps-ios-sdk – W.K.S Jun 25 '16 at 21:06
  • @W.K.S yes, I saw that, I just hoped they code it in recent two years :-) – Mazel Tov Jun 25 '16 at 21:16

2 Answers2

4

Its possible to hide the labels, landmarks and roads.

do {
     // Set the map style by passing the URL of the local file.
     if let styleURL = Bundle.main.url(forResource: "mapStyle", withExtension: "json") {
           self.mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
      } else {
           print("Unable to find style.json")
      }
   } catch {
       print("One or more of the map styles failed to load. \(error)")
  }

Where mapStyle.json is a json file in my project. For more detail see Google documentation.

TheTiger
  • 13,264
  • 3
  • 57
  • 82
2

It seems there is no direct answer for this feature yet. I can only think of 2 possible options namely:

  1. Use Satellite view. It has no labels/texts whatsoever.

    mapView.mapType = kGMSTypeSatellite;

  2. Use Custom Tile Overlays/Layers

Tile layers (sometimes referred to as Tile Overlays) allow you to superimpose images on top of Google's base map tiles. This is an excellent way to add data - such as points of interest or traffic information - and local imagery to your app. When combined with the kGMSTypeNone map type, tile layers effectively let you replace Google's base map data with your own.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56