/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/stationmap/StationMapView.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/stationmap/StationMapView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 488 by torben, Wed Sep 30 18:12:04 2009 UTC revision 489 by torben, Thu Oct 29 14:20:16 2009 UTC
# Line 5  import java.util.List; Line 5  import java.util.List;
5  import android.content.Intent;  import android.content.Intent;
6  import android.graphics.drawable.Drawable;  import android.graphics.drawable.Drawable;
7  import android.os.Bundle;  import android.os.Bundle;
 import android.util.Log;  
8    
9  import com.google.android.maps.MapActivity;  import com.google.android.maps.MapActivity;
10  import com.google.android.maps.MapController;  import com.google.android.maps.MapController;
# Line 22  public class StationMapView extends MapA Line 21  public class StationMapView extends MapA
21          MapController mapController;          MapController mapController;
22          MyLocationOverlay myLocation;          MyLocationOverlay myLocation;
23                    
24            @SuppressWarnings("unchecked")
25          @Override          @Override
26          protected void onCreate(Bundle icicle) {          protected void onCreate(Bundle icicle) {
27                  super.onCreate(icicle);                  super.onCreate(icicle);
# Line 34  public class StationMapView extends MapA Line 34  public class StationMapView extends MapA
34    
35                  mapController = mapView.getController();                  mapController = mapView.getController();
36                  mapController.setZoom(12);                  mapController.setZoom(12);
37                                                    
   
                   
38                  Intent launchedBy = getIntent();                  Intent launchedBy = getIntent();
39                                                    
                 GeoPair userLocation = (GeoPair) launchedBy.getSerializableExtra("userlocation");  
                 Log.i("MapView", "" + userLocation.getLatitude() + "," + userLocation.getLongitude());  
                 mapController.setCenter( userLocation.toGeopoint() );  
           
40                  Drawable defaultIcon = getResources().getDrawable(R.drawable.train_24);                  Drawable defaultIcon = getResources().getDrawable(R.drawable.train_24);
41                  StationOverlay stationOverlay = new StationOverlay(defaultIcon, this);                  StationOverlay stationOverlay = new StationOverlay(defaultIcon, this);
42                                    
# Line 54  public class StationMapView extends MapA Line 48  public class StationMapView extends MapA
48                                    
49                  myLocation = new MyLocationOverlay(this,mapView);                  myLocation = new MyLocationOverlay(this,mapView);
50                                    
51                    myLocation.runOnFirstFix( new Runnable() {
52                            @Override
53                            public void run() {
54                                    mapController.setCenter( myLocation.getMyLocation()  );
55                            }
56                    });
57                    
58                                                                    
59                  overlays.add(  myLocation );                  overlays.add(  myLocation );
60          }          }

Legend:
Removed from v.488  
changed lines
  Added in v.489

  ViewVC Help
Powered by ViewVC 1.1.20