使用nice /新的osmbonuspack包:
是否有一种方法可以立即在地图上显示标记的名称(或标题)?
所以,不用敲击标记。
发布于 2014-03-15 19:16:47
谢谢你,MKer,扩展了这个类。
下面,这是我在地图上显示文本的实现。希望这对其他人有帮助。
public class MarkerWithLabel extends Marker {
Paint textPaint = null;
String mLabel = null;
public MarkerWithLabel(MapView mapView, String label) {
super( mapView);
mLabel = label;
textPaint = new Paint();
textPaint.setColor( Color.RED);
textPaint.setTextSize(40f);
textPaint.setAntiAlias(true);
textPaint.setTextAlign(Paint.Align.LEFT);
}
public void draw( final Canvas c, final MapView osmv, boolean shadow) {
draw( c, osmv);
}
public void draw( final Canvas c, final MapView osmv) {
super.draw( c, osmv, false);
Point p = this.mPositionPixels; // already provisioned by Marker
c.drawText( mLabel, p.x, p.y+20, textPaint);
}
}在代码中可以添加:
marker = new MarkerWithLabel( mv, label);
marker.setTitle( label);
etc发布于 2014-03-07 22:37:59
当然了!很简单:
myMarker.showInfoWindow();https://stackoverflow.com/questions/22250423
复制相似问题