Browse files

Red dots as overlay

  • Loading branch information...
1 parent fcc3a21 commit 3f4b6c4cbcd17e7e2c15fd35c51a06fff6c4a629 Adam Bengtsson committed May 16, 2011
Showing with 26 additions and 13 deletions.
  1. +26 −13 src/org/pathpal/GMapsActivity.java
View
39 src/org/pathpal/GMapsActivity.java
@@ -31,6 +31,7 @@
import android.view.MenuItem;
import com.amelie.driving.DrivingDirections;
+import com.amelie.driving.Placemark;
import com.amelie.driving.Route;
import com.amelie.driving.DrivingDirections.IDirectionsListener;
import com.amelie.driving.DrivingDirections.Mode;
@@ -94,12 +95,23 @@ public void onDirectionsAvailable(Route route, Mode mode) {
mapOverlays = mapView.getOverlays();
- Drawable drawable = this.getResources().getDrawable(R.drawable.icon);
+ Drawable drawable = this.getResources().getDrawable(android.R.drawable.ic_notification_overlay);
itemizedOverlay = new CustomItemizedOverlay(drawable, this);
- OverlayItem overlayitem = new OverlayItem(gps.get(0), "hello", gps.size()+"");
+ //OverlayItem overlayitem = new OverlayItem(gps.get(0), "hello", gps.size()+"");
- itemizedOverlay.addOverlay(overlayitem);
+ for(Placemark p : route.getPlacemarks()){
+ OverlayItem o = new OverlayItem(p.getLocation(), "", p.getInstructions());
+
+ // o.setMarker(R.drawable.i);
+
+ itemizedOverlay.addOverlay(o);
+ //itemizedOverlay.
+ }
+
+
+
+ //itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
mapOverlays.add(new PathOverlay(gps));
@@ -158,16 +170,7 @@ public void draw(Canvas canvas, MapView mapv, boolean shadow){
- // define the menu from the XML
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.gmapmenu, menu);
- return true;
- }
-
-
- static final int FIND_PATH_REQUEST_CODE = 0;
+ static final int FIND_PATH_REQUEST_CODE = 0;
static final int YOUR_LOCATION_REQUEST_CODE = 1;
// method to handle a menu button action when you press the menu button
@@ -196,6 +199,16 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
+ // define the menu from the XML
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.gmapmenu, menu);
+ return true;
+ }
+
+
+
// Called when an activity you launched exits,
//giving you the requestCode you started it with,
//the resultCode it returned,

0 comments on commit 3f4b6c4

Please sign in to comment.