Articles and Tutorials
GSControl
A control that belongs to a map. This class is abstract and should not be used directly.
Object
|
+--GSControl
| Field Summary | |
| <static> <final> int | ANCHOR_BOTTOM_LEFT Constant for specifying that a map control should be anchored in the bottom left corner of the map viewport |
| <static> <final> int | ANCHOR_BOTTOM_RIGHT Constant for specifying that a map control should be anchored in the bottom right corner of the map viewport |
| <static> <final> int | ANCHOR_TOP_LEFT Constant for specifying that a map control should be anchored in the top left corner of the map viewport |
| <static> <final> int | ANCHOR_TOP_RIGHT Constant for specifying that a map control should be anchored in the top right corner of the map viewport |
| Constructor Summary | |
| GSControl (name) | |
| Method Summary | |
| Object | getDefaultPosition() Returns to the map the position in the map viewport where the control should appear. |
| void | remove(<GSMap> map) Called by the map when this control is removed so that it can do any clean up necessary. |
| void | render(map) Called by the map instance the control is added to, this method creates the DOM elements for this control. |
| Field Detail |
ANCHOR_BOTTOM_LEFT
<static> <final> int ANCHOR_BOTTOM_LEFT- Constant for specifying that a map control should be anchored in the bottom left corner of the map viewport
- See Also:
- Constant Field Values
ANCHOR_BOTTOM_RIGHT
<static> <final> int ANCHOR_BOTTOM_RIGHT- Constant for specifying that a map control should be anchored in the bottom right corner of the map viewport
- See Also:
- Constant Field Values
ANCHOR_TOP_LEFT
<static> <final> int ANCHOR_TOP_LEFT- Constant for specifying that a map control should be anchored in the top left corner of the map viewport
- See Also:
- Constant Field Values
ANCHOR_TOP_RIGHT
<static> <final> int ANCHOR_TOP_RIGHT- Constant for specifying that a map control should be anchored in the top right corner of the map viewport
- See Also:
- Constant Field Values
| Constructor Detail |
GSControl
GSControl(name)-
- name - a unique identifier for the map control
Parameters:
| Method Detail |
getDefaultPosition
Object getDefaultPosition()- Returns to the map the position in the map viewport where the control should appear. This positioning information can be overriden by passing a position object as the second argument to GSMap.addControl()
-
- a position object specifying where the control should be anchored and the offset of the control from the edge of the map viewport, for example:
{anchor: GSControl.ANCHOR_TOP_LEFT, offset: new GSPoint(7, 7)}
remove
void remove(<GSMap> map)- Called by the map when this control is removed so that it can do any clean up necessary. This method should not be called directly, to remove a map control use GSMap.removeControl() instead.
-
- map - the map instance this control has been added to
Parameters:
render
void render(map)- Called by the map instance the control is added to, this method creates the DOM elements for this control. Within render() the control class is required to return a reference to outermost DOM element to the map

