问 题
I show this link but answer was just only display the balloon.
Picture with a border as a map overlay
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.
I am done display the 3-5 images in map. But now I just want to display that images with border.
Thanks in advance.
解决方案
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);本文地址:IT屋 » Image with border in map overlay using android
问 题
我显示此链接,但答案只是显示气球。
具有边框的图片作为地图叠加层
但是我发现就像显示图像与边框....像这样。
如果有人有任何关于如何做到这一点的想法请帮助我。
我已经在地图上显示了3-5张图片。但是现在我只想用边框显示图像。
提前感谢
解决方案
这里是一些代码绘制一个圆圈:
私有类ProximityOverlay扩展覆盖{
public void draw(Canvas canvas,MapView mapview,boolean b){
//在这里绘制一些东西,如
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setStrokeWidth(2.0f);
double latitude = location.getLatitude();
double longitude = location.getLongitude();
投影投影= mapView.getProjection();
GeoPoint leftGeo = new GeoPoint((int)(纬度* 1e6),
(int)(longitude * 1e6));
左点= 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);
}
您可以修改它绘制一个黑色矩形:
canvas.drawRect(left,top,right,bottom,paint);
本文地址:IT屋 » 图像与边框在地图叠加使用android