MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setClickable(true); MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.add(mapOverlay);
MapView mapView = new MapView(this, mapkey); MapController mc=mapView.getController(); GeoPoint myLocation = null; Drawable drawable = this.getResources().getDrawable(R.drawable.map_marker); myItemizedOverlay itemizedoverlay = new myItemizedOverlay(drawable, this); GeoPoint ppoint = new GeoPoint(platt,plngg); //platt and plngg xml parser value lattitude and Longitude OverlayItem poverlayitem = new OverlayItem(ppoint,bankname,name of the place); itemizedoverlay.addOverlay(poverlayitem); mapOverlays.add(itemizedoverlay); myLocation = new GeoPoint(platt,plngg); mc.animateTo(myLocation); mapView.setBuiltInZoomControls(true); mapView.setClickable(true); mc.setZoom(14); mapView.invalidate(); return mapView;
public class MyMapActivity extends MapActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RelativeLayout relativeLayout = new RelativeLayout(this); setContentView(relativeLayout); final MapView mapView = new MapView(this, DEBUG_MAP_API_KEY); RelativeLayout.LayoutParams mapViewLayoutParams = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.FILL_PARENT,RelativeLayout.LayoutParams.FILL_PARENT ); relativeLayout.addView(mapView, mapViewLayoutParams); RelativeLayout.LayoutParams zoomControlsLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT ); zoomControlsLayoutParams.addRule (RelativeLayout.ALIGN_PARENT_BOTTOM); zoomControlsLayoutParams.addRule (RelativeLayout.CENTER_HORIZONTAL); relativeLayout.addView(mapView.getZoomControls(), zoomControlsLayoutParams); mapView.setClickable(true); mapView.setEnabled(true); }
public class FaramapActivity extends MapActivity { MapView mapView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_screen); mapView = (MapView) findViewById(R.id.mapView); mapView.setClickable(true); mapView.setBuiltInZoomControls(true); mapView.setMapFile(new File("/path/to/file/on/sd_card")); mapView.getController().setZoom(12); } }
map.setClickable(true);
public class MapFragment extends Fragment { MapView gMap = null; GeoPoint gPoint = null; Location location = null; public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle) { gMap = ((NFCDemoActivity)getActivity()).getMapView(); return this.gMap; } public void onActivityCreated(Bundle paramBundle) { super.onActivityCreated(paramBundle); ((NFCDemoActivity)getActivity()).calculateLocation(); gPoint = ((NFCDemoActivity)getActivity()).getGeoPoint(); gMap.setClickable(true); gMap.setBuiltInZoomControls(true); gMap.getController().setZoom(18); gMap.getController().setCenter(gPoint); } public void onDestroy() { super.onDestroy(); } }
mapView.setClickable(true);
mapView.setClickable(true); setContentView(mapView);
mapView.setClickable(true); mapView.setBuiltInZoomControls(true); mapView.setMultiTouchControls(true);
mMapView.setClickable(true); mMapView.setUseDataConnection(false); mMapView.setTileSource(TileSourceFactory.MAPNIK);