Select to view content in your preferred language

SetLocationAcquiringSymbol problem (10.2.2)

2723
6
03-10-2014 08:02 AM
teamIgal
Deactivated User
Hello,

I set a special symbol for the option of SetLocationAcquiringSymbol.
I was positive that this symbol will appear when i have no GPS signal and/or when i turn the GPS off. However i see no difference in the symbol from when i got GPS signal or not.

How can i know when i am in the state of acquiring GPS? Isn't it supposed to be everytime i have no signal (The gps icon is blinking)?
OR is there a bug there?

Thanks,
Team Igal
0 Kudos
6 Replies
teamIgal
Deactivated User
Does anyubody tried to use custom PictureMarkerSymbol with the location manager?

I am also have a problem in the first time i get a location -
my custom symbol is changing to be the default blue circle...

Thanks in advance
Team Igal
0 Kudos
MichaelAdams1
Emerging Contributor
Team Igal,

I have tested this myself against our current release and it is working as expected. However, I believe I may be able to explain what you're experiencing.

As far as location acquiring symbol, dependent on your surroundings, you may see this very seldomly. In my own testing, the easiest way to verify that my custom location acquiring symbol was indeed being used was to change the Location settings in the Android device to "Device only", as opposed to "High Accuracy". With "Device Only", ONLY the GPS sensor will be used, not the network / cell sensors. The reason "High Accuracy" is usually on by default is that the network / cell sensors can typically get you a very quick, albeit inaccurate fix. Then, once the GPS sensor has gotten a fix, you can get your much more accurate fix from that. However, if you turn it to "Device Only", and you start the application from within a building with no clear view of the sky, it can take a few minutes to get a GPS lock, and you can see the location acquiring symbol for this entire time. If at any point you take a step outside (if it's not too cloudy), you should almost immediately get a location lock and see it switch to the "default symbol".

As for your second post... If you set the default symbol to a custom symbol, this should not be changing when you get a new fix. What you may be experiencing is our new logic of showing movement direction. Our standard blue dot with a white outline is the "default symbol", while the same icon with a small white arrow pointing straight up is our "course symbol" (what you would expect to see from navigating). By default, once you start moving, (i.e. the location update from Android's LocationManager has a speed and a bearing), we will use this bearing to rotate the course symbol to point in the direction you are actually moving, and that is displayed instead of the default symbol. Once you come to a stand still again, you should see the symbol revert back to the simple blue dot with white outline. If your desire is to only show one symbol regardless of your movement, then what you'll want to do is set your custom symbol in both "setDefaultSymbol" and "setCourseSymbol"

Please let me know if this solves your problem!

Best regards,
Michael Adams
0 Kudos
teamIgal
Deactivated User
Hello MikeyNick,

Thank you for your reply.

1. MY device is set to GPS satellites only. Meaning - my network in the device is completly off - and i am getting the location fix only from the GPS satellites . I am sitting in my office - where i have no GPS signal - and i can see in my device the there is no GPS signal (i can see the GPS sign blinking). I set a custom location acquiring symbol and i don't see it. I see my custom default symbol for the wwhole time.

2. I set all the possible symbols to be my own symbols. That includes the Default, Acquiring, Course symbols. And yes - everytime i enter the "OnLocationChanged" event of the locationManager - its appears that all my custom symbol i set before returns to be the default on (the blue circle). So i ended up setting the symbols in the event itself (meaning - setting them every second...) and only this way it works. Of course it looks bad...

Thanks,
Ilona
0 Kudos
MichaelAdams1
Emerging Contributor
Ilona,

May I ask what device you're using? And could you provide a code snippet where you're setting up the LocationDisplayManager?

I performed my testing on a Moto X running Android 4.4. In case it may provide any assistance, I've pasted below my code snippet for my Activity, where I set up the LocationDisplayManager

public class HelloWorld extends Activity {

        MapView mMapView;
        LocationDisplayManager ldm;

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            mMapView = new MapView(this);
            mMapView.addLayer(new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer")); 
            setContentView(mMapView);
  
     try {
         ldm = mMapView.getLocationDisplayManager();
         PictureMarkerSymbol check = new PictureMarkerSymbol(this, getResources().getDrawable(R.drawable.checkmark));
         PictureMarkerSymbol gps2 = new PictureMarkerSymbol(this, getResources().getDrawable(R.drawable.gps2));
         ldm.setLocationAcquiringSymbol(gps2);
         ldm.setDefaultSymbol(check);
         ldm.setCourseSymbol(check);
         ldm.start();
     } catch(Exception e) {
      e.printStackTrace();
     }
 }

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

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


Best regards,
Michael
0 Kudos
teamIgal
Deactivated User
unfortunately i cant provide code samples, but i am using Samsung Galaxy S3 with android version 4.1.1.

I have the same code as you wrote - with one slight difference - i initialized the LocationDisplayManager property in the OnStatusChanged event of the MapView OnStatusChangedListener - so that i will make sure that the mapView is initialized before i set the LocationDisplayManager.
0 Kudos
MichaelAdams1
Emerging Contributor
Ilona,

I moved my LocationDisplayManager intialization code to the onStatusChangedListener, as you are doing in your code. I was not able to get my hands on an S3 running 4.1.1, but I tested on a Moto X running 4.4.2, an S3 running 4.3, and a Motorola Razr HD running 4.1.2

On all of these devices, the functionality worked as expected. Sitting in my office with the location set to "device only", I get my custom location acquiring symbol. As I then walk outside, my symbol gets changed to my custom default symbol. I can get many location updates, and it never gets changed back to the pre-packaged blue/white symbols. I cannot seem to reproduce your issue.

Can you try it on another device? I really doubt that the device is the problem, but I just want to eliminate another factor. It seems we have almost identical code, so I can't imagine what else the problem may be.

Best regards,
Michael

EDIT: got ahold of an S3 running 4.1.2, still worked as expected on there as well.
0 Kudos