Class MMViewer

Object
   |
   +--MMViewer
Direct Known Subclasses:
MultimapViewer

class MMViewer

Defined in MultimapOpenAPI


Constructor Summary
MMViewer ( map, div_element )
            This is the base mapviewer class.
 
Method Summary
 boolean addEventHandler( <String> eventType, <Function> handlerFunction )
           Adds an event handler.
 void addOverlay( <MMOverlay> overlay )
           A function for adding an overlay (marker, info box or polyline) to the mapviewer.
 void addWidget( <MMWidget> widget )
           Adds a Widget to the mapviewer.
 void assignIgnoreEvents( <HTMLElement> element )
           Sets up handlers for a HTML element to stop the mapviewer responding.
 boolean beenDrawn()
           Returns true if the viewer has been drawn.
 void cancelSmoothMove()
           Cancels a smooth move which is in progress.
 Object drawAndPositionMap( <MMLocation> location )
           Draws a map centered on a specific position.
 void endManageLayout( element )
           De-register a HTML element for management by the API.
 MMPoint geoPosToContainerPixels( <MMLatLon> position )
           When given a position in an appropriate coordinate system this method returns the pixel coordinates for that location within the viewer.
 MMLocation getAutoScaleLocation( <Array> entries )
           Returns the correct scale and centerpoint to fit the set of points or markers in the mapviewer.
 Array getAvailableZoomFactors()
           Function to retrieve the range of available zoom factors available for this map type.
 MMDimensions getBrowserDimensions()
           Function for getting the dimensions of the browser; this function uses a number of methods so should work in all browsers supported by the mapviewer.
 HTMLElement getContainer()
           Retrieves a reference to the HTML element that contains the mapviewer elements.
 MMLatLon getCurrentPosition()
           Gets the current position of the map.
 MMDimensions getDimensions()
           A method to retrieve the dimensions of the mapviewer.
 boolean getDraggable()
           DEPRECATED Use getOption( 'drag' ) instead.
 Object getGreatCircleDistance( <MMLatLon> first, <MMLatLon> second, <String> units )
           Retrieves the "Great Circle" distance between two locations specified as Lat/Lon coordinates (or MMLocations containing MMLatLons).
 MMBox getInnerDimensions()
           A method to retrieve the inner dimensions of the mapviewer.
 boolean getKeyboardPanning()
           DEPRECATED Use getOption( 'keyboard' ) instead.
 MMBounds getMapBounds()
           Returns the bounds of the rectangle displayed in the mapviewer.
 MMLatLon getMapPositionAt( <MMPoint> step, <MMLatLon> relative_to )
           Returns the position at the given pixel offset.
 boolean getMouseWheelZoom()
           DEPRECATED Use getOption( 'mousewheel:wheelup' ) and getOption( 'mousewheel:wheeldown' ) instead.
 HTMLDivElement getNamedLayer( <String> name, <Integer> zIndex )
           Gets a named layer for drawing overlays on.
 mixed getOption( <String> name )
           Get the value of an option.
 boolean getSmoothPanning()
           DEPRECATED Use getOption( 'smoothpan' ) instead.
 String getVersion()
           Returns a string describing the version of the API in use.
 Object getXMLHTTPRequest()
           Returns an XMLHTTPRequest object.
 boolean getZoomDoubleClickable()
           DEPRECATED Use getOption( 'doubleclick' ) instead.
 boolean getZoomDraggable()
           DEPRECATED Use getOption( 'drag:shift' ) instead.
 integer getZoomFactor()
           Function to return the current zoom_factor that the map is set to.
 void goToPosition( <MMLocation> new_pos, <integer> zoom_factor, <String> reason, <boolean> no_reset )
           Centers the map on a new geographical position.
 void manageLayout( <HTMLElement> element )
           Register that you want the API to manage the layout of a HTML element in Internet Explorer.
 MMPoint mortonToTile( morton )
           Takes a morton number and converts to a tile coordinate.
 void moveMap( <MMPoint> new_step, <String> reason )
           Move the map to a specified pixel offset.
 void moveMapMeters( <MMPoint> new_step, <String> reason )
           Moves the map to a position a number of meters away.
 void panToPosition( <MMLocation> new_pos, <String> reason )
           Allows the user to smoothly pan to a location, no matter how far away it is.
 Object redisplayOverlay( overlay )
           redisplayOverlay is now an alias to addOverlay().
 void redrawMap()
           Redraws the mapviewer.
 void removeAllOverlays()
           A function to remove all overlays from the mapviewer that have been added by createMarker, createInfoBox and addOverlay().
 boolean removeEventHandler( <String> eventType, <Function> handlerFunction )
           Removes an event handler for the given type.
 void removeOverlay( <MMOverlay> overlay )
           A function to remove an overlay from the mapviewer.
 void removeWidget( <MMWidget> widget )
           Removes a widget from the mapviewer.
 MMLocation resetPosition()
           Resets the position of the map to the last requested position.
 void resize( <MMPoint> resized_side )
           This function alerts the mapviewer to a change in container size.
 Array setAllowedZoomFactors( <integer> minimum, <integer> maximum )
           Sets the maximum and minimum zoom factors.
 void setDraggable( <boolean> draggable )
           DEPRECATED Use setOption( 'drag', 'dragmap' ) instead.
 void setKeyboardPanning( <boolean> value )
           DEPRECATED Use setOption( 'keyboard', 'pan' ) instead.
 void setMouseWheelZoom( <boolean> value )
           DEPRECATED Use setOption( 'mousewheel:wheelup', 'zoomin ) and setOption( 'mousewheel:wheeldown', 'zoomout' ) instead.
 void setOption( <String> name, <String> value )
           Set a mapviewer option.
 void setOptions( <Array> options )
           Set many options by passing in an object literal.
 void setSmoothPanning( <boolean> smooth_panning )
           DEPRECATED Use setOption( 'smoothpan', boolean ) instead.
 void setZoomDoubleClickable( <boolean> doubleclick_zoom )
           DEPRECATED Use setOption instead.
 void setZoomDraggable( <boolean> zoom_draggable )
           DEPRECATED Use setOption( 'drag:shift', 'zoombox' ) instead.
 void setZoomFactor( <integer> new_zoom_factor, <String> reason )
           Function to set the current zoom factor of the map.
 String tileToMorton( <MMPoint> tile, <integer> zoom_factor )
           A method that can be used to convert tile coordinates into a morton number.
 void updateLayout( <HTMLElement> el )
           Updates the size of an element if the browser is <= IE6.
 boolean withinMoveLimits( <MMPoint> step )
           A method to determine whether the requested move is within the limits of the mapviewer.
 integer zoom( <integer> amount, <String> reason, <MMPoint> pre_step, <MMPoint> post_step )
           Zooms the map within the mapviewer.

Constructor Detail

MMViewer

MMViewer( map, div_element )

Method Detail

addEventHandler

boolean addEventHandler( <String> eventType, <Function> handlerFunction )

addOverlay

void addOverlay( <MMOverlay> overlay )

addWidget

void addWidget( <MMWidget> widget )

assignIgnoreEvents

void assignIgnoreEvents( <HTMLElement> element )

beenDrawn

boolean beenDrawn()

cancelSmoothMove

void cancelSmoothMove()

drawAndPositionMap

Object drawAndPositionMap( <MMLocation> location )

endManageLayout

void endManageLayout( element )

geoPosToContainerPixels

MMPoint geoPosToContainerPixels( <MMLatLon> position )

getAutoScaleLocation

MMLocation getAutoScaleLocation( <Array> entries )

getAvailableZoomFactors

Array getAvailableZoomFactors()

getBrowserDimensions

MMDimensions getBrowserDimensions()

getContainer

HTMLElement getContainer()

getCurrentPosition

MMLatLon getCurrentPosition()

getDimensions

MMDimensions getDimensions()

getDraggable

boolean getDraggable()

getGreatCircleDistance

Object getGreatCircleDistance( <MMLatLon> first, <MMLatLon> second, <String> units )

getInnerDimensions

MMBox getInnerDimensions()

getKeyboardPanning

boolean getKeyboardPanning()

getMapBounds

MMBounds getMapBounds()

getMapPositionAt

MMLatLon getMapPositionAt( <MMPoint> step, <MMLatLon> relative_to )

getMouseWheelZoom

boolean getMouseWheelZoom()

getNamedLayer

HTMLDivElement getNamedLayer( <String> name, <Integer> zIndex )