Class CanvasMap

Constructor for the main CanvasMap object @public, @constructs

Static Functions

ReturnsFunctionThrows
SetPopupWindow(NewPopupWindow)
HidePopupWindow()
MouseWheel()

Object Functions

ReturnsFunctionThrows
SetImageFolder(ImageFolder)
SetCoordinateUnits(CoordinateUnits)
SetDebugPanel(NewDebugPanel)
AddToDebugPanel(NewHTML)
SetElement(ElementIndex, Element)
TheElement GetElement(ElementIndex)
Initialize(AllowMouseEvents)
AddRightSticky(TheElement, MoveFlag, Offset)
AddBottomSticky(TheElement, MoveFlag, Offset)
TheScene GetScene()
TheView GetView()
SetProjector(TheProjector)
SetMaxBounds(TheBounds)
SetZoomRange(MinZoom, MaxZoom)
SelectTool(NewTool)
SetCurrentTab(TabIndex)
AddLayer(NewLayer)
AddBackground(NewLayer)
StartMap(ResizeFlag)
ZoomIn()
ZoomOut()
ZoomToMax()
ZoomToBounds(TheBounds)
ZoomTo(ZoomLevel)
SetRefCenter(RefX, RefY)
Resize(ParentElement)

Static Functions


SetPopupWindow(NewPopupWindow)

Sets the current popup window and hides any existing windows

Parameters:
    NewPopupWindow - the DOM element with the visible window


HidePopupWindow()

Sets the current popup window and hides any existing windows

Object Functions


SetImageFolder(ImageFolder)

Sets the folder containing the images for the CanvasMap interface

Parameters:
    ImageFolder - path to the folder with the images


SetCoordinateUnits(CoordinateUnits)

Changes the coordinate units

Parameters:
    CoordinateUnits - one of the coordinate definitions:


SetDebugPanel(NewDebugPanel)

Sets the element for the debugging panel to show debuging messages

Parameters:
    NewDebugPanel - DOM element for the text (can just be a div element)


AddToDebugPanel(NewHTML)

Adds the specified HTML content to the debugging panel. Remember to clear the debugging panel periodically or this function becomes very slow.

Parameters:
    NewHTML - HTML to add to the Debugging panel


SetElement(ElementIndex, Element)

Function to provide an existnig element in place of the one that CanvasMap will create by default. The user can also specify "null" which will prevent the element from being created.

Parameters:
    ElementIndex - CanvasMap element definition for the element to set (i.e. CanvasMap.MAP_CONTAINER).
    Element - the element to replace the standard CanvasMap element


TheElement GetElement(ElementIndex)

Get the element from CanvasMap based on the predefined indexes

Parameters:
    ElementIndex - CanvasMap element definition for the element to set (i.e. CanvasMap.MAP_CONTAINER).

Returns: TheElement the DOM element for the specified element definition or NULL if unavailable.


Initialize(AllowMouseEvents)

This is the function to call to initialize the CanvasMap. It sets up the member variables, links the objects together, and sets up the event handlers.

Parameters:
    AllowMouseEvents - optional parameter, if false, distables mouse events for the map elemeents.


AddRightSticky(TheElement, MoveFlag, Offset)

Makes an element "sticky" to the right side of the page (i.e. the width will resize)

Parameters:
    TheElement - the element to make sticky
    MoveFlag - true to move, false to size
    Offset - number of pixels to offset the element from the right side of the frame


AddBottomSticky(TheElement, MoveFlag, Offset)

Makes an element "sticky" to the bottom of the page (i.e. the height will resize)

Parameters:
    TheElement - the element to make sticky
    MoveFlag - true to move, false to size
    Offset - number of pixels to offset the element from the bottom of the frame


TheScene GetScene()

Return the scene object that contains the layers for the map

Returns: TheScene the current scene for this map.


TheView GetView()

Return the view object for the map

Returns: TheView the current view for this scene.


SetProjector(TheProjector)

Set the projection for coordinate conversion

Parameters:
    TheProjector - the projector to use to project coordinates


SetMaxBounds(TheBounds)

Set the maximum bounds for the map to be panned to

Parameters:
    TheBounds - bounds defined by { XMin,XMax,YMin,YMax }


SetZoomRange(MinZoom, MaxZoom)

Set the minimum and maximum zoom values

Parameters:
    MinZoom
    MaxZoom


SelectTool(NewTool)

Set the current tool selected for interacting with the map

Parameters:
    NewTool - sets the current tool (e.g. CMView.TOOL_INFO)


SetCurrentTab(TabIndex)

Set the tab that is currently displayed based on an index to the tabs from left to right.

Parameters:
    TabIndex - desired tab index (0 for layer list, 1 for backgrounds, 2 for search)


AddLayer(NewLayer)

Add a layer to the map. The layer will be on top of other layers

Parameters:
    NewLayer - CMLayer object to add to the map


AddBackground(NewLayer)

Add background to the list

Parameters:
    NewLayer - CMLayer object to add to the backgrounds. Only one background will


StartMap(ResizeFlag)

StartMap() should be called after all the layers are added to start up the map and fill out the layer list. Layers can be added and removed later as well but the user may see them being added.

Parameters:
    ResizeFlag - If true, the map will be resized right away. Otherwise, the size


ZoomIn()

called to zoom the map in by 2x


ZoomOut()

called to zoom the map out by 2x


ZoomToMax()

Zooms the map to the maximum specified value


ZoomToBounds(TheBounds)

called to zoom the map to a specific area of the scene.

Parameters:
    TheBounds - boundary object { XMin,XMax,YMin,YMax}


ZoomTo(ZoomLevel)

Zooms to the specified zoom level

Parameters:
    ZoomLevel - level to zoom to, 1=1 pixel per map unit, 2=pixels per map unit, etc.)


SetRefCenter(RefX, RefY)

Centers the map at RefX,RefY

Parameters:
    RefX - Longitude or easting for the center of the map
    RefY - Latitude or northing for the center of the map


Resize(ParentElement)

Called to resize the map

Parameters:
    ParentElement - The DOM objet to size the map to.