0
我需要在iOS應用程序中爲我的Google地圖屏幕創建一個GMSMarker
。我需要標記爲圖像的組合,即通用標記圖像和用戶圖像。 例如:如何在Swift中使用組合圖像創建GMSMarker
在這個標記中,我需要適合用戶的圖像。我的資產中都有圖片。 它試圖
func image(byDrawingImage image: UIImage, inRect rect: CGRect) -> 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
}
但這返回一個不完美的圖像。 有替代解決方案嗎? 注意:這裏提供的示例標記圖像不是我實際使用的圖像。這是一個矩形標記。
可能你想在這裏:https://developers.google.com/地圖/文檔/ IOS-SDK /標記 – Pushp