Skip to content

Commit

Permalink
refactor(main):now we used offline coordinate convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCShou committed Oct 16, 2022
1 parent 4eb13ea commit 3e58fd1
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 112 deletions.
12 changes: 2 additions & 10 deletions app/src/main/java/com/zcshou/gogogo/HistoryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,14 @@ private void initRecordListView() {
mRecordListView.setOnItemClickListener((adapterView, view, i, l) -> {
String bd09Longitude;
String bd09Latitude;
String wgs84Longitude;
String wgs84Latitude;
//bd09坐标
String bd09LatLng = (String) ((TextView) view.findViewById(R.id.BDLatLngText)).getText();
bd09LatLng = bd09LatLng.substring(bd09LatLng.indexOf('[') + 1, bd09LatLng.indexOf(']'));
String[] latLngStr = bd09LatLng.split(" ");
bd09Longitude = latLngStr[0].substring(latLngStr[0].indexOf(':') + 1);
bd09Latitude = latLngStr[1].substring(latLngStr[1].indexOf(':') + 1);
//wgs84坐标
String wgs84LatLng = (String) ((TextView) view.findViewById(R.id.WGSLatLngText)).getText();
wgs84LatLng = wgs84LatLng.substring(wgs84LatLng.indexOf('[') + 1, wgs84LatLng.indexOf(']'));
String[] latLngStr2 = wgs84LatLng.split(" ");
wgs84Longitude = latLngStr2[0].substring(latLngStr2[0].indexOf(':') + 1);
wgs84Latitude = latLngStr2[1].substring(latLngStr2[1].indexOf(':') + 1);

if (!MainActivity.showLocation(bd09Longitude, bd09Latitude, wgs84Longitude, wgs84Latitude)) {

if (!MainActivity.showLocation(bd09Longitude, bd09Latitude)) {
GoUtils.DisplayToast(this, getResources().getString(R.string.history_error_location));
}
this.finish();
Expand Down
Loading

0 comments on commit 3e58fd1

Please sign in to comment.