android地图,怎么添加自定义InfoWindow

2025-03-10 20:01:19
推荐回答(1个)
回答1:

看api这样添加是没问题的.

LatLng pt = new LatLng(39.93923,116.357428);

View bubble = new View(this);

bubble.setBackgroundResource(R.drawable.screenshot4);

//创建InfoWindow,传入view,地理坐标,y 轴偏移量

InfoWindow mInfoWindow = new InfoWindow(bubble, pt, -47);

//显示InfoWindow

mBaiduMap.showInfoWindow(mInfoWindow);