百度地图的Android SDK中支持在地图上添加各种覆盖物,其中包括
// 定位坐标偏移
point = new LatLng(lat+0.0001, lng);
OverlayOptions textOption = new TextOptions()
.bgColor(0xAAFFFF00)
.fontSize(24)
.fontColor(0xFFFF00FF)
.text("test "+formatter.format(date))
.position(point);
// 在地图上添加该文字对象并显示
mBaiduMap.addOverlay(textOption);
TextView textView = new TextView(MapFragment.this.getActivity());
textView.setGravity(Gravity.CENTER);
// textView.setBackgroundResource(R.drawable.icon_gcoding);
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
textView.setTextColor(Color.RED);
textView.setShadowLayer(3, 0, 0, Color.BLACK);
textView.setText("test\n"+formatter.format(date)+"\n");
textView.destroyDrawingCache();
textView.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
textView.layout(0, 0, textView.getMeasuredWidth(), textView.getMeasuredHeight());
textView.setDrawingCacheEnabled(true);
Bitmap bitmapText = textView.getDrawingCache(true);
BitmapDescriptor bd = BitmapDescriptorFactory.fromBitmap(bitmapText);
OverlayOptions oo = new MarkerOptions().icon(bd).
position(point);
mBaiduMap.addOverlay(oo);
bd.recycle();
文字加密小工具v3
请输入要加密的内容
博主友情提示:
如您在评论中需要提及如QQ号、电子邮件地址或其他隐私敏感信息,欢迎使用