I think you are missing a call to invalidate() on map view after adding the
overlay.

-Shashi

On Fri, Oct 29, 2010 at 12:26 PM, Hendrik Greving <fourhend...@gmail.com>wrote:

> Trying to draw a circle at a longitude/latitude position. The circle below
> doesn't show up, does anybody know why?
>
> latitude, longitude is known here
>
> List<Overlay> mapOverlays = mapView.getOverlays();
> ColorDrawable myCircle = new ColorDrawable();
> mCirc = new Canvas();
> mPaint = new Paint();
> mPaint.setStyle(Paint.Style.FILL);
> mPaint.setColor(0xee444444);
>
> GeoPoint gp = new GeoPoint(latitude, longitude);
> MapController mc = mapView.getController();
> mc.setZoom(18);
> if (mc != null) {
> mc.animateTo(gp);
> }
>
> // mapView is the current mapView from MapViewActivity
> Projection proj = mapView.getProjection();
> Point mp = proj.toPixels(gp, null);
>
> mCirc.drawCircle(mp.x, mp.y, 50, mPaint);
> //myCircle.setBounds(mp.x-100, mp.y-100, mp.x+100, mp.y+100); // do I need
> this???
> myCircle.draw(mCirc);
>
> // MyItemizedOverlay is defined in the project
> MyItemizedOverlay itemizedoverlay = new MyItemizedOverlay(myCircle);
> OverlayItem overlayitem = new OverlayItem(gp, title, "");
> itemizedoverlay.addOverlay(overlayitem);
> mapOverlays.add(itemizedoverlay);
>
>
> --
> 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

-- 
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

Reply via email to