package edu.ncsu.soc.project3; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.widget.ListView; public class FriendMapper extends MapActivity { private FriendsMapOverlay mapOverlay; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.friend_map); // create the map overlay Drawable marker = getResources().getDrawable(R.drawable.marker); marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight()); mapOverlay = new FriendsMapOverlay(this, marker); // configure the friends list ListView list = (ListView)findViewById(R.id.FriendList); list.setAdapter(new FriendViewAdaptor(this)); // configure the map MapView mapView = (MapView)findViewById(R.id.MapView); mapView.getController().setCenter(new GeoPoint(35772052, -78673718)); mapView.getController().setZoom(15); mapView.getOverlays().add(mapOverlay); } public void addMarkerAtCurrentLocation(String markerName) { // TODO get current GPS coordinates and plot them on the map // NOTE: there should only be one marker on the map per person // mapOverlay.addMarker(...); //redraw the map MapView mapView = (MapView)findViewById(R.id.MapView); mapView.invalidate(); } @Override protected boolean isRouteDisplayed() { return false; } }