我已经实现了TabActivity,其中有3个选项卡。每个选项卡都包含一个地图视图。 当我切换标签时,
一个标签的地图显示在其他水龙头的地图顶部。
这是我在标签内的地图代码:
GoogleMap map;
public void mapshow(String Message,int mapId) {
// google map start
SupportMapFragment fragment;
fragment =(SupportMapFragment)getSupportFragmentManager().findFragmentById(mapId);
// Getting reference to Google Map
map = fragment.getMap();
// Clear all the markers from the Google Map
map.clear();
MarkerOptions markerOptions = new MarkerOptions();
LatLng point = new LatLng(latitude, longitude);
// Setting position for the marker
markerOptions.position(point);
// Setting custom icon for the marker
markerOptions.icon(BitmapDescriptorFactory
.fromResource(R.drawable.marker));
// Setting title for the info window
markerOptions.title(Message);
// markerOptions.snippet("Showing a demo map marker.");
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
// Move the camera to the user's location and zoom in!
map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(
latitude, longitude), 14.0f));
// Adding the marker to the map
Marker marker = map.addMarker(markerOptions);
marker.showInfoWindow();
map.setOnMarkerClickListener(this);
map.getUiSettings().setZoomControlsEnabled(false);
// end google
}
那么当我切换标签时如何隐藏以前选择的标签的地图?