可以在地圖上顯示多個InfoWindow框架
這個框架可以在地圖上的marker上顯示多個infoWindow(高德默認(rèn)只能同時顯示一個infoWindow)
效果圖如下:
image
使用
!!!!! 請?jiān)谑褂们?將高德地圖的sdk加到工程中
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.jikun2008:YisingleMarkerView:v1.0.4'
}
private LatLng startlatLng = new LatLng(30.65769, 104.062388);
startPointMarkerView = new PointMarkerView.Builder(getApplicationContext(), getAmap())
.setPosition(startlatLng)
.setIcon(BitmapDescriptorFactory.fromResource(R.mipmap.amap_start))
.create();
startPointMarkerView.bindInfoWindowView(new BaseMarkerView.BaseInfoWindowView<String>(R.layout.info_window, "start") {
@Override
public void bindData(MapInfoWindowViewHolder viewHolder, String data) {
viewHolder.setText(R.id.tvInfoWindow, data);
}
});
startPointMarkerView.addToMap();
startPointMarkerView.showInfoWindow("開始");