android界面中,已可显示地图,并可在地图中标注 "天府广场" 出来,
标注的代码如下:
class MyLocationOverlay extends Overlay
{
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
Paint paint = new Paint();
Point myScreenCoords = new Point();
mapView.getProjection().toPixels(mGeoPoint, myScreenCoords);
paint.setStrokeWidth(1);
paint.setARGB(255, 255, 0, 0);
paint.setStyle(Paint.Style.STROKE);
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint);
canvas.drawText("天府广场", myScreenCoords.x, myScreenCoords.y, paint);
return true;
}
}现:1 目前 天府广场坐标不知显示的是什么位置
2 需给 赋一坐标 (JINMXPJOJTHLLD KPGUVTJOLLLLL),如何弄呀,thanks
标注的代码如下:
class MyLocationOverlay extends Overlay
{
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
Paint paint = new Paint();
Point myScreenCoords = new Point();
mapView.getProjection().toPixels(mGeoPoint, myScreenCoords);
paint.setStrokeWidth(1);
paint.setARGB(255, 255, 0, 0);
paint.setStyle(Paint.Style.STROKE);
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint);
canvas.drawText("天府广场", myScreenCoords.x, myScreenCoords.y, paint);
return true;
}
}现:1 目前 天府广场坐标不知显示的是什么位置
2 需给 赋一坐标 (JINMXPJOJTHLLD KPGUVTJOLLLLL),如何弄呀,thanks
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货