Any example of what I may be missing? Thanks! On Jan 31, 12:10 pm, Kevin Duffey <andjar...@gmail.com> wrote: > Hmm.. I don't know.. I did not set the overlay position.. I just added it to > my mapView and mine shows up. Try working with your location settings. I am > not sure why the Location is needed tho. I use an ItemizedOverlay for a list > of items I pull down from a server, which works fine. My map then responds > to a click on an item, and puts another overlay above it with text. > > On Sun, Jan 31, 2010 at 9:44 AM, andrew android <andygoldm...@gmail.com>wrote: > > > > > My map overlay is not showing up after several attempts > > > Here is my Overlay class code: > > > public class myOverlay extends Overlay{ > > > private final int mRadius = 6; > > �...@override > > public void draw(Canvas canvas, MapView mapView, boolean > > shadow) { > > super.draw(canvas, mapView, shadow); > > Projection projection = > > mapView.getProjection(); > > // if (shadow == false) { > > Double latitude = location.getLatitude()*1E6; > > Double longitude = location.getLongitude()*1E6; > > GeoPoint geoPoint; > > geoPoint = new > > GeoPoint(latitude.intValue(),longitude.intValue > > ()); > > Point point = new Point(); > > projection.toPixels(geoPoint, point); > > RectF oval = new RectF(point.x - mRadius, point.y - > > mRadius, > > point.x + mRadius, point.y + mRadius); > > // Setup the paint > > Paint paint = new Paint(); > > paint.setARGB(250, 255, 0, 0); > > paint.setAntiAlias(true); > > paint.setFakeBoldText(true); > > Paint backPaint = new Paint(); > > backPaint.setARGB(175, 50, 50, 50); > > backPaint.setAntiAlias(true); > > RectF backRect = new RectF(point.x + 2 + mRadius, > > point.y - > > 3*mRadius, point.x + 65, point.y + mRadius); > > // Draw the marker > > canvas.drawOval(oval, paint); > > canvas.drawRoundRect(backRect, 5, 5, backPaint); > > canvas.drawText(noteName, point.x + 2*mRadius, > > point.y, paint); > > > // } > > // else { > > > // } > > > } > > �...@override > > public boolean onTap(GeoPoint point, MapView mapView) { > > // Return true if screen tap is handled by this overlay > > return false; > > } > > Location location; > > > public Location getLocation() { > > return location; > > } > > public void setLocation(Location location) { > > this.location = location; > > } > > String noteName; > > public String getNoteName(){ > > return noteName; > > } > > public void setNoteName(String n){ > > this.noteName = n; > > } > > } > > > Here is the call to add the overlay: > > > positionOverlay = new myOverlay(); > > Location loc = new Location("over"); > > loc.setLatitude(lat); > > loc.setLongitude(lng); > > positionOverlay.setLocation(loc); > > positionOverlay.setNoteName(nm); > > mapView.getOverlays().add(positionOverlay); > > mapView.invalidate(); > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en- Hide quoted text - > > - Show quoted text -
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en