Search code examples
androidgoogle-mapsgoogle-maps-android-api-2google-polyline

Drawing a polyline that ends in a curve with Google Maps Android API v2


I'm converting an application from v1 to v2, and I'm running into a problem : the old application used the draw function of the Overlay class to display lines between different locations. All of those lines ended in a curve such as below :

example

I'm thinking about replacing this by a polyline with points very close to each other, in order to make it look like a curve from afar. But I'm afraid it would consume way too much memory. Does anyone have a better idea ? Is it possible to draw a line over the map with a canvas ?


Solution

  • I don't think you should worry too much about the memory issue. The new Google maps API have something called Circle, which seems to practically be a bunch of polylines and it doesn't consume huge amounts of memory as far as I've noticed.

    Also, I have an application with loads of different polylines with 1k nodes each, and the navigation on the map is still smoother than with just a few overlays in API v1.