Select to view content in your preferred language

IdentifyLayersAsync never completes if 1 layer has refresh interval

962
4
Jump to solution
04-08-2024 03:52 AM
EirikH
by
Regular Contributor

We have a map with ~10 feature layers. We recently wanted one of the layers to auto refresh every 20 seconds so we used featureLayer.setRefreshInterval on that layer.

If we do that, our mapView.identifyLayersAsync done listener is never triggered.

 

 ListenableFuture<List<IdentifyLayerResult>> identifyTask = mMapView
        .identifyLayersAsync(new android.graphics.Point((int) e.getX(), (int) e.getY()), 22.0, false, 4);
    identifyTask.addDoneListener(() -> {
      try {
        boolean foundItem = false; // <-- HERE
        List<IdentifyLayerResult> results = identifyTask.get();

 

If we have the applicable layer visible, trigger identify and then hide the layer, the listener is triggered immediately. If we load the app without setting refresh interval on the layer it works.

We have the exact same code and layers on the iOS side as well, and there identify works as expected with refreshInterval.

Any thoughts?

Edit: We are running 100.15.4, I tried downgrading to 100.13.0 (oldest our app can run) with the same results.

0 Kudos
1 Solution

Accepted Solutions
EirikH
by
Regular Contributor

Thanks again for your reply, @RamaChintapalli.

So the issue was actually a very nice gotcha in the runtime SDK.

For iOS the refreshInterval property on a AGSFeatureLayer is specified in seconds, but for Android the setRefreshInterval method expects milliseconds. We have a shared config for both plattforms in our app so it was set to 20 (seconds) on iOS and thus 20 milliseconds on Android which seem to have caused this 😄

Android: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/FeatureL...
iOS: https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html#ae8e926cc4aa917fb...

 

View solution in original post

0 Kudos
4 Replies
EirikH
by
Regular Contributor

Anyone from Esri seeing the same or able to test?

0 Kudos
RamaChintapalli
Esri Contributor

Hi 
I have tried to set refresh interval on the FeatureLayer in this sample and I couldn't reproduce the problem i.e., the identify seems to work even with the refresh interval set. Can you use the sample and modify it to reproduce the problem? If not, we might have to look into the specifics of the layers being used in your map.

Thanks
Rama

0 Kudos
EirikH
by
Regular Contributor

Thanks for testing and the suggestion, I will try to reproduce. I'm using java and that sample was Kotlin, will try to use the java sample in my testing.

0 Kudos
EirikH
by
Regular Contributor

Thanks again for your reply, @RamaChintapalli.

So the issue was actually a very nice gotcha in the runtime SDK.

For iOS the refreshInterval property on a AGSFeatureLayer is specified in seconds, but for Android the setRefreshInterval method expects milliseconds. We have a shared config for both plattforms in our app so it was set to 20 (seconds) on iOS and thus 20 milliseconds on Android which seem to have caused this 😄

Android: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/FeatureL...
iOS: https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html#ae8e926cc4aa917fb...

 

0 Kudos