图像地图覆盖边框采用了android与 [英] Image with border in map overlay using android
本文介绍了图像地图覆盖边框采用了android与的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我显示这个链接,但答案仅仅只显示气球。
带有边框作为地图叠加 <图片/ p>
不过,我发现就像显示影像边框....筛选。
如果任何一个有关于如何做到这一点任何想法,请帮助我。
我做的地图显示3-5的图像。但现在我只想显示与边界图像。
先谢谢了。
解决方案
这里是一些code绘制一个圆:
私有类ProximityOverlay扩展覆盖{ 公共无效画(油画画布,MapView类MapView类,布尔B){
//画一些东西在这里,如
涂料粉刷=新的油漆();
paint.setAntiAlias(真);
paint.setStrokeWidth(2.0F);
双纬度= location.getLatitude();
双经度= location.getLongitude();
投影投影= MapView.getProjection()在;
GeoPoint的leftGeo =新的GeoPoint((int)的(纬度* 1e6个电子),
(中间体)(经度* 1e6个电子));
点左=新点();
projection.toPixels(leftGeo左); paint.setColor(Color.parseColor(#00CCFF));
paint.setStyle(Style.FILL);
canvas.drawCircle(left.x,left.y,9,漆);
paint.setColor(Color.parseColor(#003399));
paint.setStyle(Style.STROKE);
canvas.drawCircle(left.x,left.y,10,漆); }
您可以修改它画一个黑色矩形:
canvas.drawRect(左,上,右,下,涂料);
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);
这篇关于图像地图覆盖边框采用了android与的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文