android 百度地图设置中心点,Android百度地图SDK文字覆盖物的换行和旋转中心点问题...

百度地图的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号、电子邮件地址或其他隐私敏感信息,欢迎使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值