The new LocationDisplayManager, Bugs or Not

4720
3
03-13-2014 07:49 AM
AlaaRasheed
New Contributor
Dears, Can anyone help me with the following scenario...

When I use LocationDisplayManager instead of the deprecated LocationService everything works fine but I am having side effects when I am trying to zoom programmatically to locations, the map will always zoom to current location after zooming to the provided location and if I do some panning on the map then try to zoom programmatically to any location the map then will zoom to completely different location which is not even my current location.

So I guess my question is, should I set some properties first to the LocationDisplayManager and why on earth changing location gots overridden ?!!!!!


this how I start the LocationDisplayManager

public void onStatusChanged(Object source, STATUS status) {
 
    if (source == _mapView && status == STATUS.INITIALIZED) {
  
_esriLS = _mapView.getLocationDisplayManager();
  
_esriLS.setAutoPanMode(AutoPanMode.OFF);

_esriLS.start();
  
    }
}
0 Kudos
3 Replies
AlaaRasheed
New Contributor
The walkaround provided in this post (http://forums.arcgis.com/threads/104596-Issues-related-to-animations-in-10.2.2-sdk) has solved my problem, I still think that there is something in the displaye manager that causing these side effects.

I have modify my zoom function putting the zoom line inside a runnable

public void zoomToPoint(double longitude, double latitude, boolean draw){

  final Point pnt = GeometryEngine.project(longitude, latitude, _mapView.getSpatialReference());
 
  if(draw)
   DrawMarker(pnt);
 
  final int res = draw ? 1 : 2;
 
  new Handler().postDelayed(new Runnable() {
   public void run() {
    _mapView.zoomToResolution(pnt, res);
   }
  }, 1500);
}
0 Kudos
GSauers
Occasional Contributor

Hello Alaa, have you seen a memory leak with the new LocationDisplayManager? I am experiencing this issue to the point where my application crashes. The listener is not actually unregistered and the fragment remains open, so I have numerous instances of my fragment open.

Thanks.

0 Kudos
DanO_Neill
Occasional Contributor III

Alaa Rasheed​ What version of the SDK were you using orginally? 

G Sauers​ We will have a fix for that in the next release, but I am concerned that your app is crashing as the memory issue in 10.2.5 is ~2MB which should not crash your app.  I would be interested in more of what your app does to see if we can optimize it in other ways.

0 Kudos