Class MVMapDecoration
MVMapDecoration defines a stationary map decoration feature on the map.
The map decoration object is not moved when the map is dragged or
recentered. Its size
is not changed when the map is zoomed in or out. The MVMapDecoration is
displayed above all base map and FOI layers.
The positioning of the MVMapDecoration object is
specified by its position relative to the upper-left corner from the map.
The relative position is not specified in pixels, instead it is specified
in the percentage relative to the map window size.
The horizontal position
is specified by parameter left, which should be a float number in the range of 0-1.
The absolute offset of the MVMapDecoration object center from the left map
window border in pixels is left*map_window_width.
The vertical position is
specified by parameter top, which should be a float number in the range of 0-1.
The absolute offset of the MVMapDecoration object center from the top map
window border in pixels is top*map_window_height.
Constructor Attributes | Constructor Name and Description |
---|---|
MVMapDecoration(content, left, top, width, height, xOffset, yOffset)
|
Method Attributes | Method Name and Description |
---|---|
addEventListener(eventType, listener)
This method is deprecated.
|
|
attachEventListener(eventType, listener)
This method attaches an event listener to the MVMapDecoration.
|
|
collapse()
This method minimizes the map decoration object and displays it as a
minimized icon.
|
|
detachEventListener(event, listener)
This method detaches an event listener that has previously been attached to the MVMapDecoration
by #attachEventListener.
|
|
enableEventPropagation(enabled)
This method enables event propagation from the map decoration.
|
|
This method returns the container DIV object of the map decoration.
|
|
This method gets the current screen location of the map decoration.
|
|
This method returns whether the map decoration is collapsed.
|
|
This method gets whether the map decoration can be moved by dragging it using the mouse.
|
|
This method gets the visibility of the map decoration object
|
|
setCollapsible(collapsible, minimizeWhenCreated, style)
This methods sets whether the map decoration object is collapsible.
|
|
setDraggable(movable)
This method sets whether the user can drag and move the map decoration using the mouse.
|
|
setEventListener(eventType, listener)
This method is deprecated.
|
|
setMouseCursorStyle(cursorStyle)
This method sets the mouse cursor style when the mouse is over the map decoration
object.
|
|
setOffset(xOffset, yOffset)
This method sets the pixel offset of the map decoration object relative to its position specified by the left and
top parameter in the constructor.
|
|
setPosition(left, top, xOffset, yOffset)
This method sets the position of the map decoration object relative to its position specified by the left and
top parameter in the constructor.
|
|
setPrintable(printable)
This methods sets whether the map decoration will be printed when the MVMapView.print method is called.
|
|
setTitleBar(titleText, titleIconURL, titleInfoTip)
This methods sets the title bar content of the map decoration.
|
|
setVisible(visible)
This method sets the visibility of the map decoration object
|
- Parameters:
- {Object} content
- the content to be displayed by the map decoration feature. It can be an html String that specifies the html code or a map control object in one of the following types, MVScaleBar, MVNavigationPanel and MVOverviewMap.
- {float} left
- left specifies the horizontal position of the map decoration object relative to the left border of the map window.
- {float} top
- top specifies the vertical position of the map decoration object relative to the top border of the map window.
- {int} width
- width specifies the width(in screen pixels) of the map decoration.
- {int} height
- height specifies the height(in screen pixels) of the map decoration.
- {int} xOffset
- xOffset is an integer that specifies the horizontal offset in pixels
- {int} yOffset
- yOffset is an integer that specifies the vertical offset in pixels
- Returns:
- None
- Parameters:
- eventType
- listener
- The MVEvent.MOUSE_CLICK listener is called when the user clicks mouse left key on the map decoration.
- The MVEvent.MOUSE_OVER listener is called when the user moves the mouse on the map decoration.
- The MVEvent.MOUSE_OUT listener is called when the user moves the mouse out of the map decoration.
- The MVEvent.COLLAPSE listener is called when the user clicks the minimize icon to collapse the map decoration.
- The MVEvent.AFTER_COLLAPSE listener is called after the map decoration is collapsed.
- The MVEvent.RESTORE listener is called when the user clicks the restore button to restore the map decoration to its original size and position.
- The MVEvent.AFTER_RESTORE listener is called after the map decoration is restored to its original size and position.
- The MVEvent.DRAG_START listener is called when the user starts dragging the map decoration by pressing the mouse left button. The current screen position of the map decoration is passed as the only parameter to the listener function. the screen position is specified as a object with x and y attributes that specifie the vertical and horizontal offsets respectively. The offsets are relative to the upper-left corner of the map window in screen pixels.
- The drag listener is called when the user is dragging the map decoration. The current screen position of the map decoration is passed as the only parameter to the listener function. the screen position is specified as a object with x and y attributes that specifie the vertical and horizontal offsets respectively. The offsets are relative to the upper-left corner of the map window in screen pixels.
- The MVEvent.DRAG_END listener is called when the user is finishes dragging the map decoration by releasing the mouse left button. The current screen position of the map decoration is passed as the only parameter to the listener function. the screen position is specified as a object with x and y attributes that specifie the vertical and horizontal offsets respectively. The offsets are relative to the upper-left corner of the map window in screen pixels.
- Parameters:
- {String} eventType
- eventType specifies the event type.
- {Function} listener
- listener specifies the listener function.
- Returns:
- None
- Returns:
- None
- Parameters:
- {String} event
- a String that specifies the type of event to be handled by the listener. It can be either MVEvent.MOUSE_CLICK, MVEvent.MOUSE_OVER, MVEvent.MOUSE_OUT, MVEvent.COLLAPSE, MVEvent.AFTER_COLLAPSE, MVEvent.RESTORE, MVEvent.AFTER_RESTORE , MVEvent.DRAG_START, MVEvent.DRAG and MVEvent.DRAG_END.
- {Function} listener
- the reference to listener function.
- Returns:
- none
- Parameters:
- {boolean} enabled
- true (to enable event propagation) or false (to disable event propagation).
- Returns:
- None
- Returns:
- The container DIV
- Returns:
- an object that specifies the screen location with attributes x and y.
- Returns:
- true if collapsed, false if not collapsed.
- Returns:
- True if the map decoration is draggable, false if the map decoration is not draggable.
- Returns:
- True if the map decoration is currently visible, false if the map decoration is not currently visible
If it is collapsible, the map decoration object can be minimized and displayed as a minimized icon by clicking the minimize button. It can be then restored to its original size by clicking the minimized icon. Currently the position parameters specified in the MVMapDecoration constructor do not have any effect on a collapsible map decoration, which is always placed at the lower right corner of the map.
If the map decoration object is collapsible, this method can set its visual style. The style parameter is an object that specifies various aspects, such as the map decoration window border, title bar, minimize button and restore button. The object has the following attributes:
- borderStyle - The CSS style string for map decoration window borders.
- titleBgImg - The URL of the title bar background image.
- titleBgImgMO - The URL of the title bar background image displayed when the mouse moves over it.
- tileBgImgMD - The URL of the title bar background image displayed when the mouse is pressed down on the title bar button.
- minBtnImg - The URL of the minimize button image.
- minBtnImgMO - The URL of the minimize button image displayed when the mouse moves over it.
- minBtnImgMD - The URL of the minimize button image displayed when the mouse is pressed down on it.
- resBtnImg - The URL of the restore button.
- resBtnImgMO - The URL of the restore button displayed when the mouse moves over it.
- resBtnImgMD - The URL of the restore button displayed when the mouse is pressed down on it.
Here is an example.
var style = { borderStyle :"1px solid #636661", titleBgImg :"/images/title_bg.png", titleBgImgMO:"/images/title_bg_over.png", tileBgImgMD :"/images/title_bg_over.png", minBtnImg :"/images/button_minimize.gif", minBtnImgMO :"/images/button_minimize.gif", minBtnImgMD :"/images/button_minimize.gif", resBtnImg :"/images/button_restore.gif", resBtnImgMO :"/images/button_restore.gif", resBtnImgMD :"/images/button_restore.gif" } ;
- Parameters:
- {Boolean} collapsible
- True if the map decoration is collapsible. The default value is false
- {Boolean} minimizeWhenCreated
- True if the map decoration is minimized when the map decoration is added to the map. The default value is false.
- {Obect} style
- the style object
- Returns:
- None
- Parameters:
- {boolean} movable
- whether the map decoration can be dragged.
- Returns:
- None
- Parameters:
- eventType
- listener
- Parameters:
- {String} cursorStyle
- A string that specifies the cursor style to be used, which must be one of the standard CSS cursor style names such as "crosshair", "pointer" and "move".
- Returns:
- None
- Parameters:
- {int} xOffset
- xOffset is an integer that specifies the horizontal offset in pixels
- {int} yOffset
- yOffset is an integer that specifies the vertical offset in pixels
- Returns:
- None
- Parameters:
- {float} left
- left specifies the horizontal position of the map decoration object relative to the left border of the map window.
- {float} top
- top specifies the vertical position of the map decoration object relative to the top border of the map window.
- {int} xOffset
- xOffset is an integer that specifies the horizontal offset in pixels
- {int} yOffset
- yOffset is an integer that specifies the vertical offset in pixels
- Returns:
- None
- Parameters:
- {Boolean} printable
- if the parameter is true, the map decoration could be printed when you call the mapview.print function. The default value is false
- Returns:
- None
- Parameters:
- {String} titleText
- a html string that specifies the title text that is displayed in the center of the title bar.
- {String} titleIconURL
- the URL of the title icon image that is displayed at the left corner of the title bar. The title icon is also displayed when the map decoration is minimized. If this parameter is omitted, the minimization icon(down arrow) is displayed in its place.
- {String} titleInfoTip
- the info tip string that is displayed when the mouse moves over the title bar.
- Returns:
- None
- Parameters:
- {Boolean} visible
- visible is a Boolean true (make the map decoration object visible) or false (make the map decoration object not visible).
- Returns:
- None