Android maps padding and map bounds -


i'm using android maps v2, i'm using padding move map controls , logo of google:

       mmap.setpadding(0, 0, 0, padding_in_px); 

on other hand need know limits of visible part of map:

       latlngbounds bounds = mmap.getprojection().getvisibleregion().latlngbounds; 

the problem if put padding, function not return me bounds of visible region on map, bounds of visible region minus padding region.

is there way when map has padding mmap.getprojection().getvisibleregion() returns actual visible bounds , not map bounds - padding bounds?

thanks

the latlngbounds bounds = mmap.getprojection().getvisibleregion().latlngbounds; can give nearleft , nearright properties, latlng type.

you can convert either nearleft or nearright screen point, using toscreenlocation(). once bottom point of visible region, can use point plus padding pixels put (ex: 100, padding_in_px). can convert point using fromscreenlocation().

latlngbounds bounds = mmap.getprojection().getvisibleregion().latlngbounds; latlng nearleft = bounds.nearleft point visiblenearleftpoint =  mmap.getprojection().toscreenlocation(nearleft); point screenbottomleftpoint = new point(visiblenearleftpoint.x, visiblenearleftpoint.y + padding_in_px); latlng screenbottomlatlng = mmap.getprojection().fromscreenlocation(screenbottomleftpoint); 

Comments