Fix PointDescription
This commit is contained in:
parent
295bb5ba21
commit
11329a72ef
1 changed files with 9 additions and 4 deletions
|
@ -158,12 +158,17 @@ public class PointDescription {
|
||||||
return pnt.zone_number + "" + pnt.zone_letter + " " + ((long) pnt.easting) + " "
|
return pnt.zone_number + "" + pnt.zone_letter + " " + ((long) pnt.easting) + " "
|
||||||
+ ((long) pnt.northing);
|
+ ((long) pnt.northing);
|
||||||
} else if (f == PointDescription.OLC_FORMAT) {
|
} else if (f == PointDescription.OLC_FORMAT) {
|
||||||
return getLocationOlcName(lat, lon);
|
try {
|
||||||
|
return getLocationOlcName(lat, lon);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "0, 0";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, LocationConvert.convert(lat, f),
|
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, LocationConvert.convert(lat, f),
|
||||||
LocationConvert.convert(lon, f));
|
LocationConvert.convert(lon, f));
|
||||||
} catch(RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, 0, 0);
|
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -180,14 +185,14 @@ public class PointDescription {
|
||||||
} else if (f == PointDescription.OLC_FORMAT) {
|
} else if (f == PointDescription.OLC_FORMAT) {
|
||||||
try {
|
try {
|
||||||
return getLocationOlcName(lat, lon);
|
return getLocationOlcName(lat, lon);
|
||||||
} catch(RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return "0, 0";
|
return "0, 0";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
return LocationConvert.convert(lat, f) + ", " + LocationConvert.convert(lon, f);
|
return LocationConvert.convert(lat, f) + ", " + LocationConvert.convert(lon, f);
|
||||||
} catch(RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return "0, 0";
|
return "0, 0";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue