简体   繁体   中英

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

I want to mark certain 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM