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.
so did similar thing adding 5 triangles different alpha in order make whole fov gradiant.
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
Post a Comment