I'm using ArcGIS for Android, version 10.1. I'm trying to add mapping technology to an existing system, and all Activities are created in-code instead of using XML files. This is something I cannot change.

I've found that when creating MapViews in this way, they will not initialise until they have been displayed on the screen. I've tried to force the view to behave as though it has been displayed on the screen, using code such as:

this.map = new MapView(context);

this.baseLayer = new ArcGISTiledMapServiceLayer(basemap);

linearLayout = new LinearLayout(context);
linearLayout.addView(map, new LayoutParams(300, 300));
int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
linearLayout.measure(spec, spec);
linearLayout.layout(0, 0, linearLayout.getWidth(), linearLayout.getHeight());

I then have the mapStatusListener which will remove the MapView from linearLayout as soon as it is initialised, freeing up the MapView to be displayed in the interface.

To pre-emp the question "just add it to the interface to make it initialise", one of the ways we are using the maps is to draw it to a bitmap instead of drawing the whole map object. Using MapViews produced tearing in the interface when scrolling, and there are likely to be multiple maps on-screen in our application. I expect that redrawing an image will be far less expensive than redrawing the MapView with all its layers, etc. Therefore, I want to draw the image off-screen and recycle the map itself, only using the image. In this scenario, there is no reason for the MapView itself to ever be drawn on the screen.

I believe almost all of my current problems could be solved if I could initialise the map off-screen, but I'm stuck on how to achieve this.

1 Answer 1


If you are not interacting with the map or have the need to update the map image you can use the ArcGIS Server REST API to fetch the image.

Example returning a JSON object


The response should look similar to the following:


Use the image returned as your static map.

  • That's useful to know, and might solve one of my problems. I'll check that out, thank you.
    – user21230
    Aug 26, 2013 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.