Adding a lot of annotations to the map is very slow and is freezing the map

Hello i’m having an issue with the annotations being added to the map that sometimes is too slow, if there are too many annotations it freezes until all are added and on some occasions I get the " XPC connection interrupted" error on Xcode.

I’m working on app that allows users to charge their vehicles on public chargers all around Europe and sometimes I get from the backend 3000+ chargers which I then convert each one to a TTAnnotation object and then add them to the mapView. Is there anyway I can optimize this?

We (my team) are currently refactoring the map page on the app and we are considering switching from mapbox to tomtom but although mapbox as a lot of problems this was not one of them. Doing this same thing on mapbox works flawlessly.

Thanks in advance

Best Regards
João Moreira

I’d suggest to show them only on defined zoom levels. For instance starting from 7 level.
And to ask the backend for those which fit within the viewport.

1 Like

Hello Przemek, I’m already requesting the backend for the ones that fit the viewport but I’m not restricting zoom level. I’m going to try that.

Thank you

The other option is to cluster them on the backend.

1 Like