Class MMMenuWidget
Object
|
+--MMWidget
|
+--MMMenuWidget
-
Direct Known Subclasses:
-
MMToolsWidget
- class
MMMenuWidget
- extends MMWidget
Defined in MultimapOpenAPI
|
Constructor Summary |
MMMenuWidget
( <String> label, <MMBox> position, <String> className )
This class defines an object that can be added to the map to give a menu
of options.
|
|
Method Summary |
void
|
addItem( <MMMenuItem> item )
Allows you to add content to the context menu.
|
void
|
addItemsJSON( items )
Allows you to add multiple items to the menu using a single call, by
passing in a javascript object literal containing the data.
|
integer
|
getItemsCount()
Retrieves the number of items in the menu.
|
void
|
removeItem( <MMMenuItem> item )
Removes an item from the menu, redraws the widget if it has been drawn already.
|
void
|
setClassName( className )
Allows the class name for the widget to be reset;
this is only valid before the context menu has been drawn.
|
MMMenuWidget
MMMenuWidget( <String> label, <MMBox> position, <String> className )
This class defines an object that can be added to the map to give a menu
of options. This widget is used to create the context menu, also the
MMToolsWidget is based on this class.
Parameters:
label - (optional) A label to place before the menu items.
position - (optional) Position at which to place the widget within the mapviewer.
className - (optional) CSS Class name to give the widget.
addItem
void addItem( <MMMenuItem> item )
Allows you to add content to the context menu.
Parameters:
item - A new item for the context menu.
addItemsJSON
void addItemsJSON( items )
Allows you to add multiple items to the menu using a single call, by
passing in a javascript object literal containing the data. This should take the format of
an array of objects with label, onclick and optional className and
and orderNumber properties. For example:
menu.addItemsJSON( [ { 'label' : 'London', 'onclick' : goToLondon }, { 'label' : 'Zoom In', 'onclick' : zoomInMap, className : 'zoomIn', index : 0 } ] );
getItemsCount
integer getItemsCount()
Retrieves the number of items in the menu.
Returns:
The number of items in the menu.
removeItem
void removeItem( <MMMenuItem> item )
Removes an item from the menu, redraws the widget if it has been drawn already.
Parameters:
item - A new item for the context menu.
setClassName
void setClassName( className )
Allows the class name for the widget to be reset;
this is only valid before the context menu has been drawn.
Documentation generated by
JSDoc on Tue Feb 26 16:25:19 2008