deptofdefense / AndroidTacticalAssaultKit-CIV

Other
32 stars 14 forks source link

Import KMZ files using the ExternalLayerDataImporter class #243

Closed suganyas closed 2 years ago

suganyas commented 2 years ago

I am trying to import the KMZ files on my ATAK map using the ExternalLayerDataImporter class and in the import data function I see there is a check

public ImportResult importData(Uri uri, String mime, Bundle b) throws IOException { if (uri.getScheme() != null && !uri.getScheme().equals("file")) { return ImportResult.FAILURE;

I assume we are expected to pass the file uri (file://path-to-file) to the function because from the subsequent code I see it reads the file from the file system in the path

So should the code be public ImportResult importData(Uri uri, String mime, Bundle b) throws IOException { if (uri.getScheme() == null || !uri.getScheme().equals("file")) { return ImportResult.FAILURE;

Since right now when I am passing the file path URl as converting it as Uri.fromFile(file) it fails and returns error. Please let me know what I am understanding is right or point me to the right direction for importing the KMZ files as may overlays