1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
View view = LayoutInflater.from(OrderMonitoringActivity. this ).inflate(R.layout.map_location, null ); TextView knight = (TextView) view.findViewById(R.id.knighttext); knight.setText( "商家位置" ); view.setDrawingCacheEnabled( true ); view.measure(MeasureSpec.makeMeasureSpec( 0 ,MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec( 0 , MeasureSpec.UNSPECIFIED)); view.layout( 0 , 0 , view.getMeasuredWidth(),view.getMeasuredHeight()); view.buildDrawingCache(); Bitmap newbmp = view.getDrawingCache(); Drawable bd = new
BitmapDrawable(newbmp); mOverlay = new
MyOverlay(bd, mMapView); GeoPoint pt = new
GeoPoint(Integer.parseInt(location[ 0 ]),Integer.parseInt(location[ 1 ])); OverlayItem item1 = new
OverlayItem(pt, "覆盖物" , "" ); item1.setMarker(bd); mOverlay.addItem(item1); |
原文:http://www.cnblogs.com/xxdc/p/3577964.html