android - Dynamically drawing polygons in Google map -


i new android. i've been trying apply field of view current location in google map. image shows fov on google map in ios.

enter image description here

so did similar thing adding 5 triangles different alpha in order make whole fov gradiant.

enter image description here

i have update fov according azimuth of device, remove triangles ,recompute them , add them again.

    for(int i=0; i<5;i++){         if(triangles[i]!=null){             triangles[i].remove();         }     //triangles=null;          la = mvalues[0]-hang/2;         lx = lon+i*math.sin(math.toradians(la))/2775;         ly = lat+i*math.cos(math.toradians(la))/2775;         ra = mvalues[0]+hang/2;         rx = lon+i*math.sin(math.toradians(ra))/2775;         ry = lat+i*math.cos(math.toradians(ra))/2775;          triangles[i] = map.addpolygon(new polygonoptions().add(new latlng(lat,lon), new latlng(ly,lx), new latlng(ry,rx)).strokecolor(color.transparent).fillcolor(color.argb(50, 0, 0, 50)));      } 

the fov blinking, , gc_concurrent happens. possible make not blinking?

thanks

https://developers.google.com/maps/documentation/android/shapes

according google documentation above.

you shall update shape calling polygon.setpoints link

rather remove/add.

hope help


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -