Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我填充了一个由地理点组成的列表。现在所有标记都是可见的,但是当我触摸一个标记时,我应该能够将该标记的详细信息显示为气球或弹出窗口,我该怎么做。除此之外,弹出/气球应该显示我的位置和标记之间的距离。多谢你们
覆盖onTap()您从ItemizedOverlay<OverlayItem>.
onTap()
ItemizedOverlay<OverlayItem>
@Override protected boolean onTap(int index) { Toast.makeText(context, "Touch on marker: \n" + overlayItemList.get(index).getTitle(), Toast.LENGTH_LONG).show(); return true; }
overlayItemList是一个ArrayList<OverlayItem>。
overlayItemList
ArrayList<OverlayItem>