dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

How to set a tag in shapes or markers #489

Closed luiguild closed 2 years ago

luiguild commented 2 years ago

https://developers.google.com/android/reference/com/google/android/gms/maps/model/Polyline#public-void-settag-object-tag

I'm trying to include a tag into a Marker or Polyline but how can I reach the setTag method? My plan is to identify the item when the user interact with it (or a group of them) using some type of id's.

I'm already tried to use polyline.android.setTag('test') and polyline.setTag('') and also polyline._android.setTag('')

Any ideas?

nickolanack commented 2 years ago

you could just store an id on the nativescript object. ie polyline._id = 'someValue' or something similar, instead of trying to use the native android method setTag - which would not be the same for IOS