0

I have try to use mapView() function and only when I click on the marker, that choose marker will change to custom marker icon. How can I change the default marker (WITH CLUSTERING).

func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {

        let poiItem = marker.userData as? POIItem
        marker.title = poiItem?.devname
        marker.snippet = poiItem?.address
        marker.icon = UIImage(named: "runcar1")
        return false
}

image

1 Answer 1

1

1 : GO to Poitem class

Add one more element to that class

 let marker = GMSMarker()

add that in init method too

and then simple called

 let myitem = POitem() 
 myitem.marker = GMSMarker(latitude:0,longitude:0)
 self.map.add(myitem)  
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.