图像与边框在地图叠加使用android [英] Image with border in map overlay using android

查看:182
本文介绍了图像与边框在地图叠加使用android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显示此链接,但答案只是显示气球。

I show this link but answer was just only display the balloon.

具有边框的图片作为地图叠加层

但是我发现就像显示图像与边框....像这样。

But I am finding just like the display images with border.... Like this.

如果有人有任何关于如何做到这一点的想法请帮助我。

If any one have any idea about how to do this so please help me.

我已经在地图上显示了3-5张图片。但是现在我只想用边框显示图像。

I am done display the 3-5 images in map. But now I just want to display that images with border.

提前感谢

推荐答案

这里是一些代码绘制一个圆圈:

here is some code that draws a circle:

private class ProximityOverlay extends Overlay {

    public void draw(Canvas canvas, MapView mapview, boolean b) {
        // draw some stuff in here, like
        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setStrokeWidth(2.0f);
        double latitude = location.getLatitude();
        double longitude = location.getLongitude();
        Projection projection = mapView.getProjection();
        GeoPoint leftGeo = new GeoPoint((int) (latitude * 1e6),
                (int) (longitude * 1e6));
        Point left = new Point();
        projection.toPixels(leftGeo, left);

        paint.setColor(Color.parseColor("#00CCFF"));
        paint.setStyle(Style.FILL);
        canvas.drawCircle(left.x, left.y, 9, paint);
        paint.setColor(Color.parseColor("#003399"));
        paint.setStyle(Style.STROKE);
        canvas.drawCircle(left.x, left.y, 10, paint);



    }

您可以修改它绘制一个黑色矩形:

you can modify it to draw a black rectangle:

canvas.drawRect(left, top, right, bottom, paint);

这篇关于图像与边框在地图叠加使用android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆