The problem is that when the bitmap is the entire map there is a lag in generating the bitmap.If the bitmap is a smaller area the lag is unnoticeable.This a bug we are fixing.The code posted earlier if executed twice works without a problem.Try using the code below, if you single tap on the map twice you will see the bitmap. map.setOnSingleTapListener(new OnSingleTapListener() { /** * */ private static final long serialVersionUID = 1L; public void onSingleTap(float arg0, float arg1) { Polygon polygon = map.getExtent(); Envelope env = new Envelope(); polygon.queryEnvelope(env); Bitmap bitmap = map.getDrawingMapCache(arg0, arg1, 100, 100));// Bitmap bitmap = map.getDrawingMapCache(0, 0,// map.getWidth(), map.getHeight())); Log.d(TAG, "width = " + map.getWidth() + " ht = " + map.getHeight()); ImageView img = new ImageView(HelloWorld.this); img.setImageBitmap(bitmap); map.addView(img); } });ThanksArchana
map.getDrawingMapCache(0f, 0f,mMapView.getWidth(), mMapView.getHeight()));
Just an update. We logged a bug for this behavior. NIM084361: MapView gets unresponsive after calling the getDrawingMapCache() method. We will target a fix in the upcoming release.Would you please comment on what you plan to do with the static image following the getDrawingMapCache() call? If we have a understanding of this we could test this method in the SDK accordingly.-Doug C, ESRI Support Services, SDK Tech Leadhttp://support.esri.com/
Simon,I've tried setting it to false after generating the map image, and i've tried calling destroyDrawingCache() and getDrawingCache().recycle();. None of them seem to solve the problem.-Andrew
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.