方法一:
调用:
Marker localMarker=mAMap.addMarker(new MarkerOptions()
.position(localLatLng)
//.icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.map_location_icon))));
/*.icon(BitmapDescriptorFactory.
fromView(getMyView(pm.getPm()+""))));*/
.icon(BitmapDescriptorFactory.fromBitmap(getMyBitmap(pm.getPm()+""))));
localMarker.setObject(pm);
getMyBitmap方法:
protected Bitmap getMyBitmap(String pm_val) {
Bitmap bitmap = BitmapDescriptorFactory.fromResource(
R.drawable.map_location_icon).getBitmap();
bitmap = Bitmap.createBitmap(bitmap, 0 ,0, bitmap.getWidth(),
bitmap.getHeight());
Canvas canvas = new Canvas(bitmap);
TextPaint textPaint = new TextPaint();
textPaint.setAntiAlias(true);
tex