开发者

using canvas.drawcircle to mark a point in google-maps android

I want to mark certa开发者_开发技巧in points in google maps,I read http://developer.android.com/resources/tutorials/views/hello-mapview.html

But the problem which I am facing is that, this method is useful when we want to show a image on top of google maps, however I want a circle which may have any given color.

Also I want to show a toast when user clicks circle(I know how this could be easily done if we use drawable)

I am unable to find a solution.

Any help would be appreciated.

Thanx in advance


To draw a circle, you should create your custom class that extends Overlay, and override the draw method

 @Override
 public void draw(Canvas canvas, MapView mapview, boolean shadow) {
        super.draw(canvas, mapview, shadow);
            paint = new Paint();
            paint.setAntiAlias(true);
            paint.setARGB(80,0,0,255);
            canvas.drawCircle( x,y,radius, paint);
 }//met

For the click, did you try to override ontap ?

Regards,
Steff

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜