Google Map Markers At The Same Address Flicker In And Out

Viewed 1654

I have installed the google maps API within my project and whenever I have 2 markers with the same coordinates the markers flicker in and out of the display. I was wondering how I should go about fixing this. Essentially I want to know if there is a way I can displace one of the markers so that the flickering goes away and both markers are visible to the user. Please note that the coordinates for each marker are inputted by the user. Currently, I display each marker through the standard marker setting code google maps provides:

let lat = Double(schoolMarkerCoords[0])
let long = Double(schoolMarkerCoords[1])

let coords = CLLocationCoordinate2D(latitude: lat!, longitude: long!)
let marker = GMSMarker(position: coords)

marker.title = markerTitle //local variable
marker.snippet = markerSnippet //local variable
marker.appearAnimation = markerAnimation //local variable
marker.map = markerMap //local variable

Any help would be appreciated!

PS: Please don't mark this as a duplicate because I couldn't find an answer suitable for doing this in swift!

0 Answers
Related