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

2025-03-10 16:16:09
推荐回答(1个)
回答1:

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);