|
MapQuest Advantage TileMap Toolkit Reference Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--MQTileMap
The MQTileMap is the javascript objects that represents the functionality of
a Mapquest Draggable map.
Defined in toolkit.js
See:
| Field Summary | |
Object |
canvasOffsetX
|
Object |
canvasOffsetY
|
Object |
dcCanvasContext
|
Object |
dcCanvasDiv
|
Object |
overlayOffsetX
|
Object |
overlayOffsetY
|
Object |
staticMapEnabled
|
Object |
surface
|
Object |
turnEventsOff
|
| Constructor Summary | |
MQTileMap
( <HTMLElement> parent, <int> zoom, <MQLatLng> mqLatLng, <string> mtype, <MQMapInit> mqmapinit )
Constructs a MQTileMap object. |
|
| Method Summary | |
void
|
addControl(<MQControl> control, <MQMapCornerPlacement> position)
Function to add control to Map. |
void
|
addOverlay(<MQOverlay> mqOverlay)
Function to add the overlay to the map. |
void
|
addOverlays(<mqOverlays> mqOverlays)
Function to add the overlays to the map from a collection. |
void
|
addPoi(<MQPoi> mqPoi)
Function to add the poi to the map. |
void
|
addPois(mqPois)
Function to add the poi to the map. |
void
|
addRouteHighlight(<MQRectLL> rectll,<String> mapserverurl,<String> sessionid,<boolean> bestfit)
Function to add route highlight to Map. |
void
|
bestFit(<boolean> keepCenter, <int> minZoomLevel, <int> maxZoomLevel)
A function that will pan and zoom the map to "best fit" to the nearest zoom level around the points contained in the map's poi collection. |
void
|
bestFitLL(<Array> arrayLL, <boolean> keepCenter, <int> minZoomLevel, <int> maxZoomLevel)
A function that will pan and zoom the map to "best fit" to the nearest zoom level around the points passed in. |
void
|
enableDragging(<boolean> benable)
Function to enable/disable map dragging. |
Object
|
getBestFitMargin()
Returns the bestFit margin in pixels. |
MQRectLL
|
getBounds()
Retrieves a MQRectLL object for the upper-left, lower-right corners of the Map. |
MQLatLng
|
getCenter()
Function to return the center of the map in geographic coordinates. |
MQDeclutter
|
getDeclutter()
Function to return a reference to the declutter object. |
boolean
|
getDragEnabled()
Function to return state of map dragging. |
MQPoint
|
getDragOffset()
Function to return the dragged offset of the map. |
MQInfoWindow
|
getInfoWindow()
Function to return a reference to the maps info window. |
string
|
getMapType()
Function to get the current map type. |
MQOverlayCollection
|
getOverlays()
Function to return overlay collection. |
MQPoiCollection
|
getPois()
Function to return poi collection. |
boolean
|
getRolloversEnabled()
Function to get if rollover functionality is on. |
MQRolloverWindow
|
getRolloverWindow()
Function to return a reference to the maps rollover window. |
Object
|
getRouteSession()
Function to return sessionid of route highlight. |
int
|
getScaleFromZoom()
Function to get the current scale of the map. |
MQSize
|
getSize()
Function to return map size. |
int
|
getZoomLevel()
Function to get the current zoom level of the map. |
void
|
HandleOverlays()
Function to take care of re-mapping overlays |
void
|
hideStaticMap()
Function to remove the static map image and return to tiled map and re-enable map events |
MQPoint
|
llToPix(<MQLatLng> mqLatLng)
Function to convert geographical coordinates to pixel coordinates relative to the current map displayed. |
void
|
openInfoWindow(<MQPoint> mqPoint)
Function to open the info window over the map at specified pixel coordinate. |
void
|
panToLatLng(<MQLatLng> mqLatLng)
Function to slide the mp to the new center specified. |
MQLatLng
|
pixToLL(<MQPoint> mqPoint)
Function to convert pixel coordinates to geographical coordinates relative to the current map displayed. |
void
|
redrawOverlays()
Function to redraw all the overlays |
void
|
removeAllOverlays()
Function to remove all overlays from the map. |
void
|
removeAllPois()
Function to remove all pois from the map. |
void
|
removeControl(<MQControl> control)
Function to remove the control from the Map. |
void
|
removeOverlay(<MQOverlay> mqOverlay)
Function to remove the overlay from the map. |
void
|
removePoi(<MQPoi> mqPoi)
Function to remove the poi from the map. |
void
|
removeRouteHighlight()
Function to remove route highlight from Map. |
void
|
replaceOverlays(myOverlayCollection)
Function to remove the current collection of overlays from the map and add the collection specified to the map. |
void
|
replacePois(<MQPoiCollection> mypois)
Function to remove the current collection of pois from the map and add the collection specified to the map. |
void
|
restoreState()
Restores the saved map position, zoom level, and map type. |
void
|
saveState()
Stores the current map position, zoom level, and map type for later retrieval. |
void
|
setBestFitMargin(bestFitMargin)
Sets the bestFit margin in pixels. |
void
|
setCenter(<MQLatLng> mqLatLng,<int> zoom)
Function to set the center of the map and optionally change the zoom level. |
void
|
setInfoContentElement(<HTMLElement> contentContainer)
Function to set the content for the info window as an HTMLElement created using the browser DOM. |
void
|
setInfoContentHTML(<string> content)
Function to set the content for the info window as HTML text. |
void
|
setInfoTitleElement(<HTMLElement> titleContainer)
Function to set the title for the info window as an HTMLElement created using the browser DOM. |
void
|
setInfoTitleHTML(<string> title)
Function to set the title for the info window as HTML text. |
void
|
setLogoPlacement(<MQMapLogo> mapLogo, <MQMapCornerPlacement> mapCornerPlacement)
Sets the position of the specified logo at the specified corner placement. |
void
|
setLogoZindex(mapLogo, index)
|
void
|
setMapType(<string> type)
Function to set the map type for this map. |
void
|
setRolloversEnabled(<boolean> benable)
Function to enable rollover behavior for when the mouse rolls over pois on the map. |
void
|
setSize(<MQSize> mqSize)
Function to resize the map. |
void
|
setZoomLevel(<int> level)
Function to zoom the map to the specified zoom level. |
void
|
showDragableMap()
Function to load a tiled map with dragging capabilities. |
Object
|
showStaticMap()
Function to load a printer friendly map by covering the tiles with static map image version and disable map manipulation events |
void
|
zoomIn()
Function to zoom the map in one zoom level. |
void
|
zoomOut()
Function to zoom the map out one zoom level. |
void
|
zoomToRect(<MQRectLL> rectLL,<boolean> keepcenter,<int> minzoom,<int> maxzoom)
Function to zoom the map to the closest zoom level that fits the specified rectangle. |
| Field Detail |
Object canvasOffsetX
Object canvasOffsetY
Object dcCanvasContext
Object dcCanvasDiv
Object overlayOffsetX
Object overlayOffsetY
Object staticMapEnabled
Object surface
Object turnEventsOff
| Constructor Detail |
MQTileMap( <HTMLElement> parent, <int> zoom, <MQLatLng> mqLatLng, <string> mtype, <MQMapInit> mqmapinit )
parent - A Browser DIV HTML element to be the map's container.
zoom - The initial zoomlevel to display the map.
mqLatLng - A point representing the center of the map.
mtype - the initial map type.
mqmapinit - The object to hold the best fit information.
| Method Detail |
void addControl(<MQControl> control, <MQMapCornerPlacement> position)
control - The MQControl derived object to add to the map.
position - the position to place the control on the map.
void addOverlay(<MQOverlay> mqOverlay)
mqOverlay - New overlay to add.
void addOverlays(<mqOverlays> mqOverlays)
mqOverlays - An overlays Collection to add.
void addPoi(<MQPoi> mqPoi)
mqPoi - New poi to add.
void addPois(mqPois)
mqPoi - New poi to add.
void addRouteHighlight(<MQRectLL> rectll,<String> mapserverurl,<String> sessionid,<boolean> bestfit)
rectll - bounding box of route highlight.
mapserverurl - server portion of URL to AAPI mapping server.
sessionid - session id to server session that contains route shape.
bestfit - true/false bestfit the map around the route shape.
void bestFit(<boolean> keepCenter, <int> minZoomLevel, <int> maxZoomLevel)
keepCenter - OPTIONAL: true will cause the map to retain the same center latitude/longitude as existed before the call; false (default) will allow the map center latitude/longitude to change.
minZoomLevel - OPTIONAL: minimum zoom level (default = 1).
maxZoomLevel - OPTIONAL: maximum zoom level (default = 16).
void bestFitLL(<Array> arrayLL, <boolean> keepCenter, <int> minZoomLevel, <int> maxZoomLevel)
arrayLL - a javascript array of MQLatLng objects.
keepCenter - OPTIONAL: true will cause the map to retain the same center latitude/longitude as existed before the call; false (default) will allow the map center latitude/longitude to change.
minZoomLevel - OPTIONAL: minimum zoom level (default = 1).
maxZoomLevel - OPTIONAL: maximum zoom level (default = 16).
void enableDragging(<boolean> benable)
benable - true/false to set state of map dragging.
Object getBestFitMargin()
MQRectLL getBounds()
MQLatLng getCenter()
MQDeclutter getDeclutter()
boolean getDragEnabled()
MQPoint getDragOffset()
MQInfoWindow getInfoWindow()
string getMapType()
MQOverlayCollection getOverlays()
MQPoiCollection getPois()
boolean getRolloversEnabled()
MQRolloverWindow getRolloverWindow()
Object getRouteSession()
int getScaleFromZoom()
MQSize getSize()
int getZoomLevel()
void HandleOverlays()
void hideStaticMap()
MQPoint llToPix(<MQLatLng> mqLatLng)
mqLatLng - point to get converted.
void openInfoWindow(<MQPoint> mqPoint)
mqPoint - the pixel coordinate to open the info window to.
void panToLatLng(<MQLatLng> mqLatLng)
mqLatLng - the new center point.
MQLatLng pixToLL(<MQPoint> mqPoint)
mqPoint - point to get converted.
void redrawOverlays()
void removeAllOverlays()
void removeAllPois()
void removeControl(<MQControl> control)
control - the control to remove.
void removeOverlay(<MQOverlay> mqOverlay)
mqOverlay - the overlay to be removed.
void removePoi(<MQPoi> mqPoi)
mqPoi - the poi to be removed.
void removeRouteHighlight()
void replaceOverlays(myOverlayCollection)
myoverlays - the new overlay collection.
void replacePois(<MQPoiCollection> mypois)
mypois - the new poi collection.
void restoreState()
void saveState()
void setBestFitMargin(bestFitMargin)
The - number of pixels to use for a bestFit margin.
void setCenter(<MQLatLng> mqLatLng,<int> zoom)
mqLatLng - point to be the new map center.
zoom - OPTIONAL: the new zoom level .
void setInfoContentElement(<HTMLElement> contentContainer)
contentContainer - the info window content element.
void setInfoContentHTML(<string> content)
content - the info window content text.
void setInfoTitleElement(<HTMLElement> titleContainer)
titleContainer - the info window title element.
void setInfoTitleHTML(<string> title)
title - the info window title text.
void setLogoPlacement(<MQMapLogo> mapLogo, <MQMapCornerPlacement> mapCornerPlacement)
mapLogo - The logo to position.
mapCornerPlacement - The corner and offset to place the logo.
void setLogoZindex(mapLogo, index)
void setMapType(<string> type)
type - the type to change the map to. See getMapType for valid values.
void setRolloversEnabled(<boolean> benable)
benable - flag to enable/disable rollover functionality of map.
void setSize(<MQSize> mqSize)
mqSize - object containing the new height and width of the map.
void setZoomLevel(<int> level)
level - the new zoom level.
void showDragableMap()
Object showStaticMap()
void zoomIn()
void zoomOut()
void zoomToRect(<MQRectLL> rectLL,<boolean> keepcenter,<int> minzoom,<int> maxzoom)
rectLL - the rectangle to use as boundary.
keepcenter - OPTIONAL:Flag to specify if current map center is used or center of rectangle is used for center of map.
minzoom - OPTIONAL:Minimum zoom level to use even if rect needs a lower zoom level to fit.
maxzoom - OPTIONAL: Maximum zoom level to use even if rect needs a higher zoom level to fit.
|
MapQuest Advantage TileMap Toolkit Reference Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||