title: How to create GMSMarker with combined images in Swift
body: <p>I need to create a <code>GMSMarker</code> for my Google Maps screen in an iOS app. I need the marker to be a combination of images, i.e. a Generic marker image and a User Image. 
  eg: <a href="https://i.stack.imgur.com/j3ymL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j3ymL.png" alt="Generic marker"></a></p>
  
  <p>Inside this marker, I need to fit the User's image. I have both the images in my assets.
  it tried</p>
  
  <pre><code>func image(byDrawingImage image: UIImage, inRect rect: CGRect) -&gt; UIImage! {
          UIGraphicsBeginImageContext(size)
  
          draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height))
  
          image.draw(in: rect)
          let result = UIGraphicsGetImageFromCurrentImageContext()
          UIGraphicsEndImageContext()
          return result
      }
  </code></pre>
  
  <p>But this returned an imperfect image.
  Is there an alternate solution?
  Note: the example marker image provided here is not the one I actually use. That is a rectangular marker.</p>