Class GSInfoWindow
This class represents the map's info window. It should not be instantiated directly as each map instance will create its own info window instance.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSInfoWindow(map)
Constructs a new info window
|
| Method Attributes | Method Name and Description |
|---|---|
|
close()
Hides this info window
|
|
|
Returns the NZMG coordinate the info window is positioned on
|
|
|
Returns the offset, in pixels, of the tip of the info window
from the NZMG coordinate at which the info window is positioned
|
|
|
getSize()
Returns the size of the info window
|
|
|
hide()
Hides the info window without closing it.
|
|
|
isHidden()
Returns
true if the info window is currently hidden. |
|
|
open(coordinate, html, options)
Displays the specified HTML markup in the info window at the given
x and y coordinates |
|
|
restore()
Restores the info window to its non-maximized size if maximized
|
|
|
setTitle(title)
Sets the info window title
|
|
|
show()
Makes the info window visible if currently hidden
|
|
|
update()
Updates the dimensions and position of the info window.
|
|
|
updateContent(html)
Updates the content of the info window.
|
Class Detail
GSInfoWindow(map)
Constructs a new info window
- Parameters:
- {GSMap} map
- the map instance the info window has been created for
Method Detail
close()
Hides this info window
{GSPoint}
getCoordinate()
Returns the NZMG coordinate the info window is positioned on
- Returns:
- {GSPoint} an NZMG coordinate
{GSPoint}
getPixelOffset()
Returns the offset, in pixels, of the tip of the info window
from the NZMG coordinate at which the info window is positioned
- Returns:
- {GSPoint} a pixel offset
{GSDimension}
getSize()
Returns the size of the info window
- Returns:
- {GSDimension} the info window size
hide()
Hides the info window without closing it. To reveal the
info window call show GSInfoWindow#show
{boolean}
isHidden()
Returns
true if the info window is currently hidden.
- Returns:
- {boolean}
trueif the info window is hidden
open(coordinate, html, options)
Displays the specified HTML markup in the info window at the given
x and y coordinates
- Parameters:
- {GSPoint} coordinate
- the coordinate to position the info window at (NZMG)
- {Mixed} html
- the HTML content to display in the info window, may either be a string or an HTML DOM node
- {Object} options Optional
- an object literal specifying content and display options for the info window. The following parameters may be specified:
- {GSPoint} options.offset
- pixel offset from the specified coordinate to position the info window at
- {String} options.title
- the text to be displayed in the info window title bar
- {boolean} options.maximizable
- if
truea maximize button will be provided for maximizing the info window - {Mixed} options.maxContent
- a DOM node or HTML string to be displayed when the info window is maximized
- {GSDimension} options.maxSize
- the size the info window body should be maximized to. If not specified will resize to relative to the map window up to the internal maximum size (1000 x 800px)
- {Function} options.onopen
- a function to be called when the info window is opened
- {Function} options.onclose
- a function to be called when the info window is closed
- {String} options.title
- the text to display in the info window title
- {boolean} options.showCloseButton
- if
truea close button will be displayed on the info window, defaults totrue
restore()
Restores the info window to its non-maximized size if maximized
setTitle(title)
Sets the info window title
- Parameters:
- {String} title
- the text to set as the info window title
show()
Makes the info window visible if currently hidden
update()
Updates the dimensions and position of the info window. Should be explicitly
called if modifying the content currently displayed by the info window. If replacing
the info window content completely use GSInfoWindow#updateContent instead.
updateContent(html)
Updates the content of the info window. If the info window is not already open this method will do nothing.
This method will automatically resize the info window and re-position if necessary.
- Parameters:
- {Mixed} html
- the HTML content to display in the info window, may either be a string or an HTML DOM node