0

I have an application where I want the google maps markers to display my own custom icon, named mapIcon.png.

my icon

However, when I run my app, I get this - there's no smaller white icon in the center. I'm really confused about why it appears like this, considering that's not even the color of my icon, and I'm not using .tintColor. (I am using a larger size of icon, which I think is why it's appearing so large).

what I see

My code looks like this, which I found by referring to both Google's documentation and answers on here:

let mapIcon = UIImage(named: "mapIcon")!.withRenderingMode(.alwaysTemplate)
let markerView = UIImageView(image: mapIcon)

// Creates a marker in the center of the map.
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20)
marker.iconView = markerView

How can I get my app to show my marker properly?

rustbird
  • 155
  • 1
  • 5
  • Check the accepted answer of this question http://stackoverflow.com/questions/40210145/google-maps-ios-sdk-custom-icons-to-be-used-as-markers – Surjeet Singh Mar 29 '17 at 11:26
  • Check this answer, I thing your doing same thing: http://stackoverflow.com/questions/42687512/how-to-create-gmsmarker-with-combined-images-in-swift/42688988#42688988 – Sagar Sukode Mar 29 '17 at 13:05

0 Answers0