public class

CalloutPopupWindow

extends Object
java.lang.Object
   ↳ com.esri.android.map.CalloutPopupWindow

This class is deprecated.
at 10.2.4 please use Callout

Class Overview

CalloutPopupWindow provides an alternative user experience to Callout. CalloutPopupWindow is implemented based on android.widget.PopupWindow. One extra feature CalloutPopupWindow provides compared to Callout is that it allows you to create multiple callouts on your MapView.

You create a CalloutPopupWindow in the same way you would create a android.widget.PopupWindow by providing a view to be displayed in the callout, a coordinate where the callout will be anchored, and offset in x and y direction. CalloutPopupWindow also accepts the same style as Callout. See CalloutStyle for more details.

 
 CalloutPopupWindow callout = new CalloutPopupWindow(view, mode, style);
 callout.showCallout(mapview, point, offsetx, offsety);
 
 

Note that because CalloutPopupWindow extends android.widget.PopupWindow, You must explicitly dismiss all callouts when the activity that contains your MapView is being destroyed. A convenient method is provided to dismiss all open callouts:

 
 protected void onDestroy() {
   super.onDestroy();
   CalloutPopupWindow.removeAll();
 }
 
 
You can also long press on the anchor point to move a callout around. And if you have set a snapping layer by calling setSnappingLayer. the callout will be snapped to the closet Feature on the map.
 
 callout.setSnappingLayer(layer);
 
 

Summary

Nested Classes
enum CalloutPopupWindow.MODE  
Public Constructors
CalloutPopupWindow(View view)
Create a callout.
CalloutPopupWindow(View view, CalloutPopupWindow.MODE mode)
Create a callout.
CalloutPopupWindow(View view, CalloutPopupWindow.MODE mode, CalloutStyle style)
Create a callout.
Public Methods
Point getCoordinates()
Gets the coordinates of the anchor point.
int getMaxHeight()
Returns the maximum height the callout window can stretch.
int getMaxWidth()
Returns the maximum width the callout window can stretch.
int[] getOffset()
Gets the offset.
CalloutStyle getStyle()
Gets the callout style.
void hide()
Hide the callout.
boolean isShowing()
True if callout is showing.
static void onDragPointerMove(MapView map, MotionEvent to)
static void onDragPointerUp(MapView map, MotionEvent to)
static boolean onLongPress(MotionEvent point)
void refresh()
Refresh the callout.
static void removeAll()
remove all callout from the MapView.
void setAnchor(int anchor)
Sets the Anchor of the callout.
void setContent(View view)
Sets the view of the callout.
void setCoordinates(Point point)
Sets the anchor point of the callout.
void setMaxHeight(int maxHeight)
Sets the maximum height the callout window can stretch to.
void setMaxWidth(int maxWidth)
Sets the maximum width the callout window can stretch to.
void setMode(CalloutPopupWindow.MODE mode)
Sets the callout mode.
void setOffset(int x, int y)
Set the offset from the anchor point.
void setSize(int width, int height)
Sets the size of the callout.
void setSnappingLayer(GraphicsLayer layer)
void setStyle(CalloutStyle style)
Sets the callout style.
void setStyle(Context context, int xmlId)
Sets the callout style in XML.
void setTolerance(int tolerance)
void showCallout(MapView mapview)
Shows the callout if it's hidden.
void showCallout(MapView mapview, Point mappoint, int xoff, int yoff)
Display callout on the MapView
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CalloutPopupWindow (View view)

Create a callout.

Parameters
view View: user defined view to be displayed in the callout

public CalloutPopupWindow (View view, CalloutPopupWindow.MODE mode)

Create a callout.

Parameters
view View: user defined view to be displayed in the callout
mode CalloutPopupWindow.MODE: display mode of the callout. If null, default to MODE.CLIP.

public CalloutPopupWindow (View view, CalloutPopupWindow.MODE mode, CalloutStyle style)

Create a callout.

Parameters
view View: user defined view to be displayed in the callout
mode CalloutPopupWindow.MODE: display mode of the callout. If null, default to MODE.CLIP.
style CalloutStyle: Callout style. If null, default background color will be WHITE, border color will be BLACK, and corner curve will 10.

Public Methods

public Point getCoordinates ()

Gets the coordinates of the anchor point.

Returns
Point coordinates of the anchor point.

public int getMaxHeight ()

Returns the maximum height the callout window can stretch.

Returns
int the maximum height of the callout window.

public int getMaxWidth ()

Returns the maximum width the callout window can stretch.

Returns
int the maximum width of the callout window.

public int[] getOffset ()

Gets the offset.

Returns
int[] offset

public CalloutStyle getStyle ()

Gets the callout style.

Returns
CalloutStyle callout style

public void hide ()

Hide the callout.

public boolean isShowing ()

True if callout is showing.

Returns
boolean true if callout is showing

public static void onDragPointerMove (MapView map, MotionEvent to)

Parameters
map MapView
to MotionEvent

public static void onDragPointerUp (MapView map, MotionEvent to)

Parameters
map MapView
to MotionEvent

public static boolean onLongPress (MotionEvent point)

Parameters
point MotionEvent
Returns
boolean

public void refresh ()

Refresh the callout.

public static void removeAll ()

remove all callout from the MapView. You should call this method from onDestroy() of your Activity.

public void setAnchor (int anchor)

Sets the Anchor of the callout.

Parameters
anchor int: callout anchor

public void setContent (View view)

Sets the view of the callout.

Parameters
view View: callout view

public void setCoordinates (Point point)

Sets the anchor point of the callout.

Parameters
point Point: coordinates for the callout

public void setMaxHeight (int maxHeight)

Sets the maximum height the callout window can stretch to.

Parameters
maxHeight int: the maximum height to set for the callout window

public void setMaxWidth (int maxWidth)

Sets the maximum width the callout window can stretch to.

Parameters
maxWidth int: the maximum width to set for the callout window

public void setMode (CalloutPopupWindow.MODE mode)

Sets the callout mode.

Parameters
mode CalloutPopupWindow.MODE: callout mode

public void setOffset (int x, int y)

Set the offset from the anchor point.

Parameters
x int: offset in x
y int: offset in y

public void setSize (int width, int height)

Sets the size of the callout.

Parameters
width int: callout width
height int: callout height

public void setSnappingLayer (GraphicsLayer layer)

Parameters
layer GraphicsLayer

public void setStyle (CalloutStyle style)

Sets the callout style.

Parameters
style CalloutStyle: callout style

public void setStyle (Context context, int xmlId)

Sets the callout style in XML.

Parameters
context Context: the context
xmlId int: resource id of the sytle

public void setTolerance (int tolerance)

Parameters
tolerance int

public void showCallout (MapView mapview)

Shows the callout if it's hidden.

Parameters
mapview MapView: mapview

public void showCallout (MapView mapview, Point mappoint, int xoff, int yoff)

Display callout on the MapView

Parameters
mapview MapView: MapView on which this callout will be displayed.
mappoint Point: Anchor point in map unit.
xoff int: Offset in X direction.
yoff int: Offset in Y direction.