Mapview zoomin, zoomto not working

311
2
12-26-2011 05:02 PM
User123
New Contributor
map = (MapView)findViewById(R.id.map);
  // Add dynamic layer to MapView
  map.addLayer(new ArcGISDynamicMapServiceLayer("" +
  "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));
  //Retrieve the non-configuration instance data that was previously returned.
  Object init = getLastNonConfigurationInstance();
   if (init != null) {
   map.restoreState((String) init);
}

map.zoomin();


i'm new to this and trying to zoom in from current map resolution.

map.zoomin and map.zoomto is not working for me.
0 Kudos
2 Replies
User123
New Contributor
Problem solved.

I need to do a OnStatusChangedListener to check the initialization status
before calling the zoomin() method.
0 Kudos
ArchanaAgarwal
New Contributor III
The solution you found is correct. To perform any operation on the map, its necessary to check if the map is initialized, especially if you are working in the OnCreate method.
0 Kudos