Open jamesjiro opened 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:
DatasetDescriptorSpi
that functions similar to the MobacMapSourceLayerInfoSpi
, with correct handling for the <tileUpdate>
tag, with a higher priority than MobacMapSourceLayerInfoSpi
.MobacTileReader
such that it is either directly implemented or relies on a TileClient
with whatever implementation modifications are required to support <tileUpdate>
. Take special note of the field, version
. The renderer tracks the value of TileReader.getTileVersion(...)
, using that as a trigger to refresh a tile's texture. We use a single version across the entire dataset -- trading complexity for update imprecision. You could also implement an entirely new TileReader
from scratch if so desired.TileReaderSpi
for the new TileReader
implementation with a priority higher than MobacTileReader.SPI
onCreate
.MapView.getMapView().getRenderer3().getRenderContext().setContinuousRenderEnabled(true)
in your plugin's onCreate
to enable on the user's behalf.<?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>
@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.
@jamesjiro The issue with the 4.4 SDK has been diagnosed; identifying the cause now.
@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.
ATAK doesn't appear to be using the
tileUpdate
entry for custom XML map sources.MobacMapSourceFactory
supports parsing thetileUpdate
entry as arefreshInterval
, 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?