Since GMSMarker only allows an UIImage to be set as icon, I implemented something similar like this: (it's in Swift, but the concept is the same for Objective C)
var gasView = UIView(frame:CGRectMake(0, 0, 30, 37))
//Add Label
var lblPrecio = UILabel(frame: CGRectMake(0, 37-18, 30, 10))
lblPrecio.text = "hello"
lblPrecio.textAlignment = NSTextAlignment.Center
gasView.addSubview(lblPrecio)
//Add Logo
var logo = UIImageView(frame: CGRectMake(30-23, 2, 16, 16))
logo.image = UIImage(named: "Logo")
gasView.addSubview(logo)
//Add Callout Background Image
gasView.backgroundColor = UIColor(patternImage: UIImage(named: "Callout")!)
marker.icon = imageFromView(gasView)
Where the function imageFromView is the following:
private func imageFromView(aView:UIView) -> UIImage {
if(UIScreen.mainScreen().respondsToSelector("scale")) {
UIGraphicsBeginImageContextWithOptions(aView.frame.size, false, UIScreen.mainScreen().scale)
}
else {
UIGraphicsBeginImageContext(aView.frame.size)
}
aView.layer.renderInContext(UIGraphicsGetCurrentContext())
var image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
Hope this helps.