Misha Akopov
Misha Akopov

Reputation: 13057

Google Map Marker userData is becomes nil after Cluster iOS

I am using Google Maps in iOS app. I set userData to markers, some String for example.

marker.userData = "SOME_ID"

When I tap on the marker I can get this userData without problem from any marker.

let data = marker.userData

I also use Clastering for my markers. When markers are grouped to cluster and when they are moved out of cluster(ungroupped), marker.userData becomes nil. For all markers. Why does it happen and how to prevent it ?

Upvotes: 0

Views: 290

Answers (1)

Sarvajeet Singh
Sarvajeet Singh

Reputation: 181

I also got this issue and after many try it didn't worked. Finally I made subclass of GMSMarker and declared a custom variable, and that solved the problem for me.

Upvotes: 1

Related Questions