|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--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( map, div_element )
| Method Detail |
boolean addEventHandler( <String> eventType, <Function> handlerFunction )
| Event type | Event target | 3rd Argument | 4th Argument | 5th Argument | ||
|---|---|---|---|---|---|---|
| click | mapviewer | position clicked on in local coordsys |
pixel distance of click from map center |
|||
| click | marker | |||||
| changeZoom | mapviewer | old zoom | new zoom | reason that zoom change occurred | ||
| changeMapType | mapviewer | old map type | new map type | |||
| mapBoundsChanged | mapviewer | reason that map bounds changed | ||||
| eventError | mapviewer | type of the event that caused the error | target of the event that caused the error | javascript exception object that was caught | ||
| dataPreferencesChanged | mapviewer | map type | new set of preferences | |||
| coverageUpdated | mapviewer | |||||
| drag | mapviewer | |||||
| startPan | mapviewer | |||||
| endPan | mapviewer | start position | end position | reason for the pan | ||
| addOverlay | overlay | |||||
| removeOverlay | overlay | |||||
| removeAllOverlays | mapviewer | |||||
| openInfoBox | overlay | parent marker | ||||
| closeInfoBox | overlay | |||||
| resize | mapviewer | old mapviewer dimensions | new mapviewer dimensions | |||
| startGeocode | mapviewer | location being geocoded | ||||
| endGeocode | mapviewer | location that was geocoded | error code if there was a problem | |||
| startRouteRequest | mapviewer | route being requested | ||||
| endRouteRequest | mapviewer | route that was requested | error code if there was a problem | |||
| startSearchRequest | mapviewer | search being requested | ||||
| endSearchRequest | mapviewer | search that was requested | error code if there was a problem | |||
| zoomFactorsChanged | mapviewer | an array of the now available zoom factors | ||||
| contextMenu | mapviewer | a reference to the context menu that will be added to the map | the geographical position that was clicked on | pixel distance of click from map center |
||
| optionChanged | mapviewer | the name of the option that was changed | the new value of the option | |||
| startMouseDrag | mapviewer/overlay | pixel distance of click from map center |
||||
| continueMouseDrag | mapviewer/overlay | pixel distance of this stage of the mouse drag | ||||
| endMouseDrag | mapviewer/overlay | pixel distance from the previous continueMouseDrag event | ||||
| overlayStartDrag | overlay | pixel distance of the drag so far | ||||
| overlayContinueDrag | overlay | pixel distance of the drag so far | ||||
| overlayEndDrag | overlay | new position of the overlay (MMLatLon for a marker, MMBounds for a rectangle) | pixel distance of the entire drag | |||
| declutterStart | mapviewer | type of decluttering (MM_DECLUTTER_AGGREGATE or MM_DECLUTTER_GRID) | group name that is being decluttered (or undefined for "unnamed markers") | |||
| declutterCluster | mapviewer | type of decluttering (MM_DECLUTTER_AGGREGATE or MM_DECLUTTER_GRID) | group name that is being decluttered (or undefined for "unnamed markers") | an array of markers that have been clustered | for aggregate decluttering, a reference to the aggregate marker, allowing you to change properties such as the label | for aggregate decluttering, an anonymous object that contains options that will be passed to setInfoBoxContent(), allowing you to change the class name |
| declutterEnd | mapviewer | type of decluttering (MM_DECLUTTER_AGGREGATE or MM_DECLUTTER_GRID) | group name that is being decluttered (or undefined for "unnamed markers") | |||
| mouseover | mapviewer/marker/polyline | for mapviewer and polyline target, the step distance from the center of the mapviewer to the mouse cursor | ||||
| mousemove | mapviewer/marker/polyline | for mapviewer and polyline target, the step distance from the center of the mapviewer to the mouse cursor | ||||
| mouseout | mapviewer/marker/polyline | for mapviewer and polyline target, the step distance from the center of the mapviewer to the mouse cursor |
eventType - Type of the event being called
handlerFunction - The event handling function
void addOverlay( <MMOverlay> overlay )
overlay - The overlay to be added to the mapviewer.
void addWidget( <MMWidget> widget )
widget - The widget to add to the mapviewer.
void assignIgnoreEvents( <HTMLElement> element )
element - HTML Element
boolean beenDrawn()
void cancelSmoothMove()
Object drawAndPositionMap( <MMLocation> location )
location - Location to start from, including zoom factor
void endManageLayout( element )
MMPoint geoPosToContainerPixels( <MMLatLon> position )
position - Position in an appropriate coordinate system.
MMLocation getAutoScaleLocation( <Array> entries )
entries - An array of overlays or geographic points.
Array getAvailableZoomFactors()
MMDimensions getBrowserDimensions()
HTMLElement getContainer()
MMLatLon getCurrentPosition()
MMDimensions getDimensions()
boolean getDraggable()
Object getGreatCircleDistance( <MMLatLon> first, <MMLatLon> second, <String> units )
first - First location.
second - Second location.
units - (optional) The units of measurement to return 'km' or the default 'miles'.
MMBox getInnerDimensions()
boolean getKeyboardPanning()
MMBounds getMapBounds()
MMLatLon getMapPositionAt( <MMPoint> step, <MMLatLon> relative_to )
step - Pixel offset from the center of the map
relative_to - (optional) Geographical coordinates you want the pixel offset relative to. Default is the center of the viewer.
boolean getMouseWheelZoom()
HTMLDivElement getNamedLayer( <String> name, <Integer> zIndex )
name - Name of layer to create.
zIndex - Value to set for the zIndex of this layer, if it does not already exist.
mixed getOption( <String> name )
name - Name of the option to get the value for.
boolean getSmoothPanning()
String getVersion()
Object getXMLHTTPRequest()
boolean getZoomDoubleClickable()
boolean getZoomDraggable()
integer getZoomFactor()
void goToPosition( <MMLocation> new_pos, <integer> zoom_factor, <String> reason, <boolean> no_reset )
new_pos - New location to go to.
zoom_factor - Zoom factor that you want to display the map at, optional
reason - Reason code for the move, for logging purposes, should usually be left out.
no_reset - If true the position moved to by resetPosition is not updated to the position passed in.
void manageLayout( <HTMLElement> element )
element - Element that you want to be managed.
MMPoint mortonToTile( morton )
morton - Morton number for the given coordinate and zoom factor
void moveMap( <MMPoint> new_step, <String> reason )
new_step - The amount to move, in pixels
reason - Reason code for the move, for logging purposes, should usually be left out.
void moveMapMeters( <MMPoint> new_step, <String> reason )
new_step - Offset from the center to move to, in metres
reason - Reason code for the move, for logging purposes, should usually be left out.
void panToPosition( <MMLocation> new_pos, <String> reason )
new_pos - New position to pan to.
reason - Reason code for the move, for logging purposes, should usually be left out.
Object redisplayOverlay( overlay )
void redrawMap()
void removeAllOverlays()
boolean removeEventHandler( <String> eventType, <Function> handlerFunction )
eventType - Type of the event being called.
handlerFunction - The event handling function.
void removeOverlay( <MMOverlay> overlay )
overlay - The overlay to be removed.
void removeWidget( <MMWidget> widget )
widget - The widget to remove from the mapviewer.
MMLocation resetPosition()
void resize( <MMPoint> resized_side )
resized_side - (optional) This parameter allows you to specify which side of the viewer has been resized.
Array setAllowedZoomFactors( <integer> minimum, <integer> maximum )
minimum - (optional) Minimum zoom factor.
maximum - (optional) Maximum zoom factor.
void setDraggable( <boolean> draggable )
draggable - The new setting.
void setKeyboardPanning( <boolean> value )
value - True to allow keyboard panning, false otherwise.
void setMouseWheelZoom( <boolean> value )
value - The value that you want to set this option to.
void setOption( <String> name, <String> value )
name - Name of the option that you want to set.
value - Value that you want to give the option.
void setOptions( <Array> options )
options - Array of options to set.
void setSmoothPanning( <boolean> smooth_panning )
smooth_panning - True if you want smooth panning enabled, false otherwise.
void setZoomDoubleClickable( <boolean> doubleclick_zoom )
doubleclick_zoom - The new setting
void setZoomDraggable( <boolean> zoom_draggable )
zoom_draggable - The new setting
void setZoomFactor( <integer> new_zoom_factor, <String> reason )
new_zoom_factor - The desired zoom factor for the map.
reason - Reason code for the move, for logging purposes, should usually be left out.
String tileToMorton( <MMPoint> tile, <integer> zoom_factor )
tile - Tile coordinates to convert.
zoom_factor - The zoom factor to use.
void updateLayout( <HTMLElement> el )
el - The element to resize.
boolean withinMoveLimits( <MMPoint> step )
step - The amount that needs to be moved, in pixels
integer zoom( <integer> amount, <String> reason, <MMPoint> pre_step, <MMPoint> post_step )
amount - The number of factors to zoom in or out by
reason - Reason code for the move, for logging purposes, should usually be left out.
pre_step - (optional) The pixel position, relative to the center, that you want to zoom into.
post_step - (optional) The pixel position, relative to the center, that you want to zoom into.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||