/** * Populates this bubble with all item info: * * <ul> * title and description in any case, * </ul> * * <ul> * image and sub-description if any. * </ul> * * and centers the map on the item. <br> */ public void showBubble(ExtendedOverlayItem item, InfoWindow bubble, MapView mapView) { Log.d(TAG, "showBubble"); // offset the bubble to be top-centered on the marker: Drawable marker = getMarker(mapView.getZoomLevel()); int markerWidth = marker.getIntrinsicWidth(); int markerHeight = marker.getIntrinsicHeight(); Point markerH = item.getHotspot(HotspotPlace.BOTTOM_CENTER, markerWidth, markerHeight); Point bubbleH = item.getHotspot(HotspotPlace.BOTTOM_CENTER, markerWidth, markerHeight); bubbleH.offset(-markerH.x, -markerH.y - markerHeight); bubble.open(item, bubbleH.x, bubbleH.y); mapView.getController().animateTo(item.getPoint()); }
/** @return the item currenty showing the bubble, or null if none. */ public OverlayItem getBubbledItem() { if (mBubble.isOpen()) return mItemWithBubble; else return null; }
/** Close the bubble (if it's opened). */ public void hideBubble() { mBubble.close(); mItemWithBubble = null; }