landsmike

Problem caused by single tap on MapView in SDK 10.2.2

Discussion created by landsmike on Mar 25, 2014
Latest reply on May 26, 2014 by landsmike
We encountered a problem in SDK 10.2.2:

After a MapView is received more than 2 single tap events, the base map (or the dynamic layer) will not be updated when we change the map scale programatically (e.g. MapView.zoomin() / zoomout() / zoomToScale() / etc.)

The only way to refresh the MapView is to do a pan or pinch manually.

The following code is for regenerating the problem. Basically, it creates a MapView, and do a "MapView.zoomin()" when OnSingleTap event is detected. You can do the following:

1) Perform a single tap on the MapView
2) Wait for 2 seconds
3) Perform a single tap on the MapView
4) Wait for 2 seconds
...

You will see the map is zooming in, but the base tiles will not refresh.

--------------------------------------------------------------------------------------------------------

package com.esri.arcgis.android.samples.helloworld;

import android.app.Activity;
import android.os.Bundle;
import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISTiledMapServiceLayer;
import com.esri.android.map.event.OnSingleTapListener;

public class HelloWorld extends Activity {

MapView mMapView = null;
ArcGISTiledMapServiceLayer tileLayer;

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  mMapView = (MapView) findViewById(R.id.map);

  tileLayer = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
 
  mMapView.addLayer(tileLayer);
 
  mMapView.setOnSingleTapListener(new OnSingleTapListener() {
  
   private static final long serialVersionUID = 1L;

   @Override
   public void onSingleTap(float x, float y) {
    mMapView.zoomin();
   }
  });
}

@Override
protected void onPause() {
  super.onPause();
  mMapView.pause();
}

@Override
protected void onResume() {
  super.onResume();
  mMapView.unpause();
}

}

----------------------------------------------------------------------------------------------------------------------

Outcomes