高德地图 怎么设置默认显示气泡
3个回答
展开全部
您可以使用自定义类来显示气泡,然后在自定义类中的onTap(int index)中设置一个一个弹出窗口来解决这个问题!
@Override
public boolean onTap(int index) {
//在此处理item点击事件
LayoutInflater inflater = LayoutInflater.from(mapView.getContext());
View view = inflater.inflate(R.layout.reserve_warning_pop, null);
TextView tv_reservewarning_pop_parkinglotname = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotname);
TextView tv_reservewarning_pop_parkinglotaddress = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotaddress);
TextView tv_reservewarning_pop_parkinglotcurrentstall = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotcurrentstall);
TextView tv_reservewarning_pop_parkinglotprice = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotprice);
if (parkingLot != null) {
//停车场名
//停车场地址
//停车场可预订车位
//停车场收费类型
}
//预定按钮
Button bt_reservewarning_pop_reserve = (Button) view.findViewById(R.id.bt_reservewarning_pop_reserve);
bt_reservewarning_pop_reserve.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//业务处理 }
}
}
});
//弹出自定义界面
popupOverlay = new PopupOverlay(mapView, null);
OverlayItem overlayItem = getItem(index);
mapView.getController().setCenter(overlayItem.getPoint());
popupOverlay.showPopup(view, overlayItem.getPoint(), 5);
mapView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//隐藏弹出窗口
popupOverlay.hidePop();
}
});
return super.onTap(index);
}
@Override
public boolean onTap(int index) {
//在此处理item点击事件
LayoutInflater inflater = LayoutInflater.from(mapView.getContext());
View view = inflater.inflate(R.layout.reserve_warning_pop, null);
TextView tv_reservewarning_pop_parkinglotname = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotname);
TextView tv_reservewarning_pop_parkinglotaddress = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotaddress);
TextView tv_reservewarning_pop_parkinglotcurrentstall = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotcurrentstall);
TextView tv_reservewarning_pop_parkinglotprice = (TextView) view.findViewById(R.id.tv_reservewarning_pop_parkinglotprice);
if (parkingLot != null) {
//停车场名
//停车场地址
//停车场可预订车位
//停车场收费类型
}
//预定按钮
Button bt_reservewarning_pop_reserve = (Button) view.findViewById(R.id.bt_reservewarning_pop_reserve);
bt_reservewarning_pop_reserve.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//业务处理 }
}
}
});
//弹出自定义界面
popupOverlay = new PopupOverlay(mapView, null);
OverlayItem overlayItem = getItem(index);
mapView.getController().setCenter(overlayItem.getPoint());
popupOverlay.showPopup(view, overlayItem.getPoint(), 5);
mapView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//隐藏弹出窗口
popupOverlay.hidePop();
}
});
return super.onTap(index);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不可以的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
请问亲说的显示气泡是指定位图标吗?目前高德地图软件中的定位图标都是蓝色气泡,暂时无法更改呢,请问亲是希望如何设置呢?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询