Fix errors
This commit is contained in:
parent
5e76919f99
commit
f87f95943a
6 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.map;
|
package net.osmand.map;
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package net.osmand.plus.download;
|
package net.osmand.plus.download;
|
||||||
|
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import net.osmand.data.IndexConstants;
|
import net.osmand.data.IndexConstants;
|
||||||
import net.osmand.map.RegionCountry;
|
import net.osmand.map.RegionCountry;
|
||||||
|
@ -25,6 +23,7 @@ public class SrtmIndexItem extends IndexItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateExistingTiles(Map<String, String> existingFileNames) {
|
public void updateExistingTiles(Map<String, String> existingFileNames) {
|
||||||
|
tilesToDownload.clear();
|
||||||
for(int i = 0; i<item.getTileSize() ; i++) {
|
for(int i = 0; i<item.getTileSize() ; i++) {
|
||||||
int lat = item.getLat(i);
|
int lat = item.getLat(i);
|
||||||
int lon = item.getLon(i);
|
int lon = item.getLon(i);
|
||||||
|
@ -78,9 +77,8 @@ public class SrtmIndexItem extends IndexItem {
|
||||||
entry.type = type;
|
entry.type = type;
|
||||||
entry.baseName = fileToDownload;
|
entry.baseName = fileToDownload;
|
||||||
String url = "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN;
|
String url = "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN;
|
||||||
//FIXME
|
url += "/download?event=2&srtm=yes&";
|
||||||
// url += "/download?event=2&";
|
url += ctx.getVersionAsURLParam() + "&";
|
||||||
// url += ctx.getVersionAsURLParam() + "&";
|
|
||||||
String fullName = fileToDownload + "_" + IndexConstants.BINARY_MAP_VERSION + IndexConstants.BINARY_MAP_INDEX_EXT_ZIP;
|
String fullName = fileToDownload + "_" + IndexConstants.BINARY_MAP_VERSION + IndexConstants.BINARY_MAP_INDEX_EXT_ZIP;
|
||||||
entry.urlToDownload = url +"/srtm/" + fullName;
|
entry.urlToDownload = url +"/srtm/" + fullName;
|
||||||
// url + "file=" + fileName;
|
// url + "file=" + fileName;
|
||||||
|
|
|
@ -1052,7 +1052,6 @@
|
||||||
<string name="osmodroid_plugin_old_ver_not_supported">Wykryto starą wersję pluginu OsMoDroid, która musi zostać zaktualizowana.</string>
|
<string name="osmodroid_plugin_old_ver_not_supported">Wykryto starą wersję pluginu OsMoDroid, która musi zostać zaktualizowana.</string>
|
||||||
<string name="osmodroid_plugin_description">Plugin OsMoDroid (TODO opis)</string>
|
<string name="osmodroid_plugin_description">Plugin OsMoDroid (TODO opis)</string>
|
||||||
<string name="map_widget_max_speed">Ograniczenie prędkości</string>
|
<string name="map_widget_max_speed">Ograniczenie prędkości</string>
|
||||||
<string name="monitoring_control_start"/>
|
|
||||||
<string name="osmodroid_plugin_name">OsMoDroid</string>
|
<string name="osmodroid_plugin_name">OsMoDroid</string>
|
||||||
<string name="tip_altitude_offset">Wyświetlanie wysokości - korygowanie przesunięcia</string>
|
<string name="tip_altitude_offset">Wyświetlanie wysokości - korygowanie przesunięcia</string>
|
||||||
<string name="monitoring_control_start">start</string>
|
<string name="monitoring_control_start">start</string>
|
||||||
|
|
|
@ -306,6 +306,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
||||||
Map<String, String> indexFileNames = getMyApplication().getResourceManager().getIndexFileNames();
|
Map<String, String> indexFileNames = getMyApplication().getResourceManager().getIndexFileNames();
|
||||||
for(SrtmIndexItem s : cached){
|
for(SrtmIndexItem s : cached){
|
||||||
s.updateExistingTiles(indexFileNames);
|
s.updateExistingTiles(indexFileNames);
|
||||||
|
filtered.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (IndexItem file : downloadListIndexThread.getCachedIndexFiles()) {
|
for (IndexItem file : downloadListIndexThread.getCachedIndexFiles()) {
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class DownloadIndexListThread extends Thread {
|
||||||
public void run() {
|
public void run() {
|
||||||
indexFiles = DownloadOsmandIndexesHelper.getIndexesList(ctx);
|
indexFiles = DownloadOsmandIndexesHelper.getIndexesList(ctx);
|
||||||
if(OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null){
|
if(OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null){
|
||||||
|
cachedSRTMFiles.clear();
|
||||||
Map<String, String> indexFileNames = new LinkedHashMap<String, String>();
|
Map<String, String> indexFileNames = new LinkedHashMap<String, String>();
|
||||||
List<RegionCountry> countries = RegionRegistry.getRegionRegistry().getCountries();
|
List<RegionCountry> countries = RegionRegistry.getRegionRegistry().getCountries();
|
||||||
for(RegionCountry rc : countries){
|
for(RegionCountry rc : countries){
|
||||||
|
|
|
@ -115,7 +115,9 @@ function update_count_of_downloads($file) {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
$xml = simplexml_load_file("indexes.xml");
|
$xml = simplexml_load_file("indexes.xml");
|
||||||
$res = $xml->xpath('//region[@name="'.$file.'"]');
|
$res = $xml->xpath('//region[@name="'.$file.'"]');
|
||||||
if(isset($_GET['road'])){
|
if(isset($_GET['srtm'])){
|
||||||
|
downloadFile('srtm/'.$file);
|
||||||
|
} else if(isset($_GET['road'])){
|
||||||
downloadFile('road-indexes/'.$file);
|
downloadFile('road-indexes/'.$file);
|
||||||
} else if (count($res) > 0) {
|
} else if (count($res) > 0) {
|
||||||
$node = $res[0];
|
$node = $res[0];
|
||||||
|
|
Loading…
Reference in a new issue