title: google maps iOS SDK: custom icons to be used as markers
body: <p>The Android API has a very convenient class for this, <a href="http://googlemaps.github.io/android-maps-utils/javadoc/com/google/maps/android/ui/IconGenerator.html" rel="noreferrer"><code>IconGenerator</code></a>. Using the <code>IconGenerator</code> <strong>in my Android app</strong>, I can easily make a marker that:</p>
  
  <ol>
  <li>is a simple rectangle with the color of my choosing. </li>
  <li>resizes to hold text of any length. </li>
  <li>is <strong>NOT</strong> an info window - I'd like the marker itself to contain the text as shown in the image below from the android version.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/ij26O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ij26O.png" alt="enter image description here"></a></p>
  
  <pre class="lang-java prettyprint-override"><code>// Android - problem solved with IconGenerator
  IconGenerator iconGenerator = new IconGenerator(context);
  iconGenerator.setStyle(IconGenerator.STYLE_GREEN); // or any other color
  Bitmap iconBitmap = iconGenerator.makeIcon(myString);
  Marker m = new MarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(iconBitmap))
                                .position(myLatLng);
  map.addMarker(m); // map is a com.google.android.gms.maps.GoogleMap
  </code></pre>
  
  <p>Is there a way to do something as simple as this in <strong>iOS using Swift</strong>?
  There has been a <a href="https://github.com/googlemaps/google-maps-ios-utils/releases/tag/v1.1.0" rel="noreferrer">recent release</a> of the iOS api that allows "marker customization", but I don't see how to apply it to this use case.</p>
  
  <pre class="lang-swift prettyprint-override"><code>// iOS (Swift) - I don't know how to create the icon as in code above
  let marker = GMSMarker(position: myLatLng)
  marker.icon = // How can I set to a rectangle with color/text of my choosing?
  marker.map = map // map is a GMSMapView
  </code></pre>