ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

[Add polygon] When drawing, last edge is only updated when map stops moving

Open gino-m opened this issue 4 years ago • 4 comments
trafficstars

We should update the edge on camera move rather than on drag finished.

@shobhitagarwal1612 Also related to your last PR.. could you PTAL?

gino-m avatar Nov 17 '21 20:11 gino-m

SGTM

shobhitagarwal1612 avatar Nov 18 '21 19:11 shobhitagarwal1612

I created a sample PR with the changes. It shows some performance issues. Possible reasons:

  1. We create a new instance of Point and CameraPosition on each position update.
  2. PolygonDrawingView listens to position updates regardless of visibility.

shobhitagarwal1612 avatar Nov 20 '21 16:11 shobhitagarwal1612

Is GoogleMapsAdapter#setMapFeatures updating only the changed features as it should, or is it updating all features on each change?

gino-m avatar Nov 22 '21 17:11 gino-m

Features are only being updated when the map stops moving. IMO, just the unregulated creation of objects on each camera motion is behind the cause. (Plus a couple of more optimisations)

shobhitagarwal1612 avatar Nov 22 '21 18:11 shobhitagarwal1612

@shobhitagarwal1612 for current status -- would you like to take this on as well?

scolsen avatar Feb 27 '23 18:02 scolsen

Closing in favor of https://github.com/google/ground-android/issues/1839

shobhitagarwal1612 avatar Sep 06 '23 04:09 shobhitagarwal1612