I'm currently using a GMSMapView in my swift app, and the energy impact is never decreasing ( as the CPU usage or Memory usage ).
Did anyone already faced this issue ?
Using Google Maps 2.0.1
I'm currently using a GMSMapView in my swift app, and the energy impact is never decreasing ( as the CPU usage or Memory usage ).
Did anyone already faced this issue ?
Using Google Maps 2.0.1
I Found the answer myself. It is related to GMSMarker.tracksViewChanges
property.
Turning it to false
for all added markers has released the CPU.
Make false
of GMSMarker()
's object property tracksViewChanges
& tracksInfoWindowChanges
let placeMarker = GMSMarker()
placeMarker.tracksViewChanges = false
placeMarker.tracksInfoWindowChanges = false
It will bringdown energy impact clock indictor.
I found google maps to consume to much memory as well. Changing tracksViewChanges worked for me as well.
Another approach that I have tried when the rendering was taking to long, is to split the rendering of the markers or views in the map.
You can use the delegate methods of GMSMapView
mapViewDidStartTileRendering(_mapView: GMSMapView)
andmapViewDidFinishTileRendering(_ mapView: GMSMapView)
to know when the render has finished and add new elements.
© 2022 - 2024 — McMap. All rights reserved.