Merge pull request 'display satelite map' (#24) from SD-220 into develop

Reviewed-on: #24
This commit is contained in:
CiufudeanDani 2022-04-08 10:54:18 +00:00
commit 33d00c27d7
2 changed files with 14 additions and 3 deletions

View File

@ -100,6 +100,17 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
} }
}); });
ImageView mapType = findViewById(R.id.changeMapTypeHeader);
mapType.setOnClickListener(view -> {
if (googleMap.getMapType() != GoogleMap.MAP_TYPE_SATELLITE) {
mapType.setImageResource(R.drawable.map);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
} else {
mapType.setImageResource(R.drawable.satellite);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
});
setDate(); setDate();
} }

View File

@ -145,11 +145,11 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
// image View for changing map type satellite or map // image View for changing map type satellite or map
ImageView changeMapTypeImageView = findViewById(R.id.changeMapType); ImageView changeMapTypeImageView = findViewById(R.id.changeMapType);
changeMapTypeImageView.setOnClickListener(v -> { changeMapTypeImageView.setOnClickListener(v -> {
if (googleMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE) { if (googleMap.getMapType() != GoogleMap.MAP_TYPE_SATELLITE) {
changeMapTypeImageView.setImageResource(R.drawable.satellite); changeMapTypeImageView.setImageResource(R.drawable.map);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
} else { } else {
changeMapTypeImageView.setImageResource(R.drawable.map); changeMapTypeImageView.setImageResource(R.drawable.satellite);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
} }
}); });