ios-maps-sdk icon indicating copy to clipboard operation
ios-maps-sdk copied to clipboard

Marker rendering issue

Open alexp25 opened this issue 1 year ago • 2 comments
trafficstars

I encountered a strange behavior with marker rendering using custom icons. The markers are loading but sometimes wrong icons are shown and they seem to swap icons and artefacting all over the place.

This is so weird that I'm adding a video: https://youtube.com/shorts/nkSTDlhLkcg?feature=share

What can be observed from the demo and is part of the unwanted and unexplained behavior:

  • markers are randomly swapping icons at each update
  • at some point, there are even partially rendered markers artefacting on the map
  • [update] this happens when there are many markers on the map (less than 100 anyway), as soon as I remove them (or they are less than 20 or so), the problem magically disappears, and as soon as I re-add them, the bug appears again

[UPDATE]

After setting up the icons this way, with the UIImageView the original problem seems to be fixed:

let markerView = UIImageView(image: newMarker.icon)
newMarker.iconView = markerView
newMarker.tracksViewChanges = true // this seems to do the trick

However, now I encounter a significant performance bottleneck when there are many markers on the map... (less than 100 markers anyway)

More details on my SO post as well: https://stackoverflow.com/questions/78627144/marker-artefacting-in-google-maps-ios-sdk-capacitor-plugin

alexp25 avatar Jun 16 '24 11:06 alexp25

I got the same issue in my project. Which version are you using? Looks like v9.0.0 and v9.1.1 have some break changes. I did a quick testing on v8.3.1 and feels like there is no problems.

YanboD avatar Nov 07 '24 11:11 YanboD

@YanboD I'm using v8.4.0. Currently, I ended up implementing my own selective rendering algorithm to work around this limitation, without the tracksViewChanges flag (which was way too slow anyway).

alexp25 avatar Nov 07 '24 14:11 alexp25