Problem caused by single tap on MapView in SDK 10.2.2

926
2
03-25-2014 08:02 AM
MikeC
by
New Contributor II
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();
}

}

----------------------------------------------------------------------------------------------------------------------
0 Kudos
2 Replies
MikeC
by
New Contributor II
From further analysis, same situation happens in the Collector for ArcGIS in Google Play (Version 10.2.2):

To regenerate the issues:

Step 1:
Select any map in available in the Collector, we selected �??Community Addressing�?�

Step 2:
After entering the map, zoom out a little bit (as we want to realized the map cannot be updated when the map is zoomed in programmatically). Then perform 2 or more single taps (Do not double tap, as the map zoom in then) on the screen
   [ATTACH=CONFIG]32717[/ATTACH]


Step 3:
Select a feature on the map
   [ATTACH=CONFIG]32716[/ATTACH]


Step 4:
Select the �??Zoom to�?� in the menu
   [ATTACH=CONFIG]32715[/ATTACH]


Step 5:
The location is zoomed in, and the dynamic layer (GraphicsLayer we believe) got updated. However, the base tiles are never getting refreshed.
   [ATTACH=CONFIG]32713[/ATTACH]


Step 6:
The only way to make the base tile refresh is to do a pan / zoom manually.
   [ATTACH=CONFIG]32714[/ATTACH]


Just a few single tap cause the issues. The situation is quite annoying for those who often use something like MapView.zoomToScale(Point, float) to show a location in MapView.
0 Kudos
MikeC
by
New Contributor II
Just tested with the new SDK 10.2.3, the problem persists.

And the same problem also occurs in ArcGIS Collector in Google Play.
0 Kudos