我想通过隐藏地图在谷歌地图上显示点。这可能吗?
我的代码是
public class SampleGeoPointsActivity extends MapActivity {
private MapView gMapView;
//private MapController mc;
//double lat=43.467604;
//double lng=-3.833841;
@Override
public void onCreate(Bundle savedInstanceState) {
// Creating and initializing Map
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try{
gMapView = (MapView) findViewById(R.id.myGMap);
gMapView.setBuiltInZoomControls(true);
//gMapView.setVisibility(MapView.INVISIBLE);
List<Overlay> mapOverlays = gMapView.getOverlays();
//gMapView.getOverlays().subList(0, 0);
Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);
GeoPoint point = new GeoPoint(35410000, 139460000);
OverlayItem overlayitem = new OverlayItem(point, "Hello", "I'm in japan City!");
GeoPoint point1 = new GeoPoint(19240000,-99120000);
OverlayItem overlayitem1 = new OverlayItem(point1, "Hello", "I'm in Mexico City!");
overlayitem.setMarker(drawable);
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.addOverlay(overlayitem1);
mapOverlays.add(itemizedoverlay);
gMapView.setVisibility(1);
gMapView.invalidate();
}catch(Exception e)
{
Log.d("Exception","Error Message"+e.getMessage());
}
}
@Override
protected boolean isRouteDisplayed() {
return false;
} }
是否可以隐藏地图视图并仅显示Google地图中的叠加层?