deptofdefense / AndroidTacticalAssaultKit-CIV

Other
908 stars 323 forks source link

tileUpdate Entry in custom XML map sources is unused #127

Open jamesjiro opened 2 years ago

jamesjiro commented 2 years ago

ATAK doesn't appear to be using the tileUpdate entry for custom XML map sources. MobacMapSourceFactory supports parsing the tileUpdate entry as a refreshInterval, but I don't see this being used to download new tiles from a map source. What would be required to add this functionality to ATAK? Could it be implemented as a plugin?

takdeveloper commented 2 years ago

@jamesjiro With ATAK 4.4, the tileUpdate-as-refreshInterval should be functional (please see below example; you may need to turn on continuous rendering [this is a bug, should be automatically refreshing]). We know this is not a valid interpretation of the MOBAC schema, but it was a quick path to get some kind of refresh ability out.

We spent some time looking into implementing per the schema during the 4.4 development cycle, but were unable to find servers that provided the appropriate response and did not have time to stand up our own test environment. We would welcome any patch that implements this feature into core.

This functionality could indeed be implemented as a plugin. Unfortunately, MobacMapSource instantiation is one of the few things that is not pluggable -- if it was, this would be a much simpler exercise. At a minimum, your the plugin would do the following:

<?xml version="1.0" encoding="UTF-8"?>
<customMapSource>
    <name>Random Image</name>
    <minZoom>0</minZoom>
    <maxZoom>2</maxZoom>
    <tileType>png</tileType>
    <tileUpdate>15000</tileUpdate>
    <url>https://picsum.photos/256</url>
    <backgroundColor>#000000</backgroundColor>
</customMapSource>
jamesjiro commented 2 years ago

@takdeveloper Thank you very much. I will try to use the tileUpdate-as-refresh functionality. I'm currently having issues running the development APK distributed in the SDK release for version 4.4.0.0. After installing the ATAK APK and going through the permissions prompts, the application is exiting to the home screen. When I try restarting the application it immediately exits. I'm running the Android Emulator (version 30.8.4) with a Pixel C tablet and Pixel 5 phone with both Android 11.0 and Android 10.0. I'm also seeing this behavior outside of the emulator on a Samsung Galaxy Tab Active2 with Android 9.0 installed.

takdeveloper commented 2 years ago

@jamesjiro The issue with the 4.4 SDK has been diagnosed; identifying the cause now.

jamesjiro commented 2 years ago

@takdeveloper I have tested the build produced by PR #128. The tileUpdate appears to be working as described. I have noticed that expired tiles seem to flicker in and out of the map view. This continues even after I disconnect my local tile server. My plugin currently adds the map source XML in the same way as the Imagery class. I have also enabled continuous rendering in the onCreate method of my MapComponent class.