带有Android GroundOverlay的大图像(2616x5952)
当使用2616x5952图像(3MB)和地面覆盖时,我得到一个OutOfMemoryError。这是我的密码:带有Android GroundOverlay的大图像(2616x5952),android,Android,当使用2616x5952图像(3MB)和地面覆盖时,我得到一个OutOfMemoryError。这是我的密码: mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setMyLocationEnabled(true); BGN = new LatLng(32.013111, 34.875231); Bitmap imag
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
mMap.setMyLocationEnabled(true);
BGN = new LatLng(32.013111, 34.875231);
Bitmap image = BitmapFactory.decodeResource(getResources(),
R.drawable.lower_ats);
BitmapDescriptor map = BitmapDescriptorFactory.fromBitmap(image);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(BGN, 11));
GroundOverlayOptions overlay = new GroundOverlayOptions()
.image(map)
.positionFromBounds(
new LatLngBounds(new LatLng(29.250000, 33.750000),
new LatLng(33.500000, 35.916667)))
.transparency((float) 0.3).visible(true);
mMap.clear();
GroundOverlay imageOverlay = mMap.addGroundOverlay(overlay);
它只是在设置位图时崩溃。谷歌没有解决方案,其他类似的问题也没有答案。请帮帮我
谢谢
编辑:除了TileOverlay,还有其他方法吗?文件可能是3MB。从磁盘加载时,
位图
约为60MB,您没有堆空间用于此。@Commonware我可以使用不带位图的GroundOverlay吗?我可以“增加”堆空间吗?我不知道。有人能帮我吗??