Merge pull request #4204 from osmandapp/add_kml_kmz_support

Fix adding kml/kmz from configure map
This commit is contained in:
Alexey 2017-07-25 19:18:32 +03:00 committed by GitHub
commit f92eee8ebf

View file

@ -73,9 +73,17 @@ public class GpxImportHelper {
public boolean handleGpxImport(final Uri contentUri, final boolean useImportDir) { public boolean handleGpxImport(final Uri contentUri, final boolean useImportDir) {
final String name = getNameFromContentUri(contentUri); final String name = getNameFromContentUri(contentUri);
final boolean isOsmandSubdir = isSubDirectory(app.getAppPath(IndexConstants.GPX_INDEX_DIR), new File(contentUri.getPath())); final boolean isOsmandSubdir = isSubDirectory(app.getAppPath(IndexConstants.GPX_INDEX_DIR), new File(contentUri.getPath()));
if (!isOsmandSubdir && name != null && name.endsWith(GPX_SUFFIX)) { if (!isOsmandSubdir && name != null) {
handleGpxImport(contentUri, name, true, useImportDir); if (name.endsWith(GPX_SUFFIX)) {
return true; handleGpxImport(contentUri, name, true, useImportDir);
return true;
} else if (name.endsWith(KML_SUFFIX)) {
handleKmlImport(contentUri, name, true, useImportDir);
return true;
} else if (name.endsWith(KMZ_SUFFIX)) {
handleKmzImport(contentUri, name, true, useImportDir);
return true;
}
} }
return false; return false;
} }