Comment puis-je montrer these kind of car images in picture sur google maps selon la latitude & longitude?Comment afficher des images personnalisées sur google maps en utilisant swift
J'ai essayé le code suivant, but I got the following incorrect result
let marker1 = GMSMarker()
let marker2 = GMSMarker()
let marker3 = GMSMarker()
let marker4 = GMSMarker()
let marker5 = GMSMarker()
let markerImage = UIImage(named: "white_car_icon copy.png")!.withRenderingMode(.alwaysTemplate)
let markerView = UIImageView(image: markerImage)
marker1.position = CLLocationCoordinate2D(latitude: 12.9077923, longitude: 77.586962)
marker2.position = CLLocationCoordinate2D(latitude: 12.9077923, longitude: 77.586962)
marker3.position = CLLocationCoordinate2D(latitude: 12.9077856, longitude: 77.58695950000001)
marker4.position = CLLocationCoordinate2D(latitude: 12.90782858, longitude: 77.58678956)
marker5.position = CLLocationCoordinate2D(latitude: 12.90780888511306, longitude: 77.58487723767757)
marker1.iconView = markerView
marker1.map = mapView
marker2.iconView = markerView
marker2.map = mapView
marker3.iconView = markerView
marker3.map = mapView
marker4.iconView = markerView
marker4.map = mapView
marker5.iconView = markerView
marker5.map = mapView
Si quelqu'un pouvait me aider, je serais reconnaissant à vous. Je l'ai essayé pendant les 4 derniers jours, mais n'a pas obtenu la sortie correcte.
avez-vous vérifié ma réponse? – Edu
@ammateja Tout en utilisant la propriété 'iconView' et en l'initialisant avec' UIImageView', vous devez également définir le cadre dans lequel il prendra le cadre de votre image qui est présent dans vos actifs –