Packagecom.mapquest.tilemap
Classpublic class TileMap
InheritanceTileMap Inheritance flash.display.Sprite



Public Properties
 PropertyDefined by
  allTilesLoaded : Boolean = false
TileMap
  allViewableTilesLoaded : Boolean = false
TileMap
  EVENT_CLICK : Number = 0
[static]
TileMap
  EVENT_DBLCLICK : Number = 1
[static]
TileMap
  EVENT_NONE : Number = -1
[static]
TileMap
  height : Number
[read-only]
TileMap
  OPER_RECENTER : Number = 0
[static]
TileMap
  OPER_RECENTERZOOM : Number = 1
[static]
TileMap
  showHyb : Boolean = false
TileMap
  showMap : Boolean = true
TileMap
  showRte : Boolean = false
TileMap
  showSat : Boolean = false
TileMap
  TYPE_HYBRID : String = "hyb"
[static]
TileMap
  TYPE_MAP : String = "map"
[static]
TileMap
  TYPE_SATELLITE : String = "sat"
[static]
TileMap
  width : Number
[read-only]
TileMap
Protected Properties
 PropertyDefined by
  currentCursor : int
TileMap
  cursorManager : CursorManager
TileMap
  globeSettings : GlobeSettings
TileMap
  mapIcons : Array
TileMap
  pois : Array
TileMap
  shadows : Array
TileMap
  zoomSettings : ZoomSettings
TileMap
Public Methods
 MethodDefined by
  
TileMap(key:String, scale:int = 1, latLng:IPointLL = null, type:String = "map", mapInit:MapInit = null)
Function to add control to Map.
TileMap
  
addControl(control:Control, position:MapCornerPlacement = null):void
Function to add control to Map.
TileMap
  
addOverlay(overlay:ShapeOverlay):void
Function to add the overlay to the map.
TileMap
  
addPoi(poi:Poi, depthType:String = "top", fireEvent:Boolean = true):void
Function to add the poi to the map.
TileMap
  
addRouteHighlight(shapeRect:IRectLL, highlightURL:String, sessionId:Object = null, bestFit:Boolean = false, keepCenter:Boolean = false, minZoom:int = 1, maxZoom:int = 16):void
TileMap
  
bestFit(keepCenter:Boolean = false, minZoom:int = 1, maxZoom:int = 16):void
TileMap
  
bestFitLL(arrayLL:Array, keepCenter:Boolean = false, minZoomLevel:int = 1, maxZoomLevel:int = 16):void
A function that will pan and zoom the map to "best fit" to the nearest zoom level around the points passed in.
TileMap
  
enableDragging(benable:Boolean):void
Function to enable/disable map dragging.
TileMap
  
TileMap
  
TileMap
  
Retrieves an IRectLL object for the upper-left, lower-right corners of the Map.
TileMap
  
Function to return the center of the map in geographic coordinates.
TileMap
  
Given a rectangle determins the amount a map must be moved for no collision in display
TileMap
  
TileMap
  
getDragEnabled():Boolean
Function to return state of map dragging.
TileMap
  
TileMap
  
TileMap
  
Function to return a reference to the maps info window.
TileMap
  
TileMap
  
getMapFriction():Number
TileMap
  
getMapType():String
Function to get the current map type.
TileMap
  
TileMap
  
Function to return poi collection.
TileMap
  
getPrintableBitmap(bitWidth:int, bitHeight:int, maintainAspectRatio:Boolean):BitmapData
TileMap
  
Function to get if rollover functionality is on.
TileMap
  
Function to return a reference to the maps rollover window.
TileMap
  
Function to return map size.
TileMap
  
TileMap
  
TileMap
  
Function to convert geographical coordinates to pixel coordinates relative to the current map displayed.
TileMap
  
TileMap
  
openInfoWindow(pointXY:IPointXY):void
Function to open the info window over the map at specified pixel coordinate.
TileMap
  
panEast(percent:Number):void
TileMap
  
panNorth(percent:Number):void
TileMap
  
panNorthEast(percent:Number):void
TileMap
  
panNorthWest(percent:Number):void
TileMap
  
panSouth(percent:Number):void
TileMap
  
panSouthEast(percent:Number):void
TileMap
  
panSouthWest(percent:Number):void
TileMap
  
panToLatLng(latLng:IPointLL):void
Function to slide the mp to the new center specified.
TileMap
  
panWest(percent:Number):void
TileMap
  
pixToLL(xy:IPointXY, wrapAround:Boolean = true):IPointLL
Function to convert pixel coordinates to geographical coordinates relative to the current map displayed.
TileMap
  
printMap():void
TileMap
  
Function to remove all overlays from the map.
TileMap
  
removeAllPois(fireRemoveEvents:Boolean = true):void
Function to remove the current collection of pois from the map Events are fired for each poi in the old collection when removed and a "mapcleared" event.
TileMap
  
removeControl(control:Control):void
Function to remove the control from the Map.
TileMap
  
Function to remove the overlay from the map.
TileMap
  
removePoi(poi:Poi, fireEvent:Boolean = true):void
Function to remove the poi from the map.
TileMap
  
TileMap
  
replaceOverlays(overlayCollection:OverlayCollection):void
Function to remove the current collection of overlays from the map and add the collection specified to the map.
TileMap
  
replacePois(poiCollection:PoiCollection):void
Function to remove the current collection of pois from the map and add the collection specified to the map.
TileMap
  
restoreState():void
Restores the saved map position, zoom level, and map type.
TileMap
  
saveState():void
Stores the current map position, zoom level, and map type for later retrieval.
TileMap
  
scrollMap(sx:Number, sy:Number):void
TileMap
  
setBackgroundColor(color:Number):void
TileMap
  
setBestFitMargin(bfm:int):void
TileMap
  
setCenter(mqLatLng:IPointLL, zoom:int = -1):void
Function to set the center of the map and optionally change the zoom level.
TileMap
  
setCenterXY(pointXY:IPointXY):void
TileMap
  
setClickOperation(event:Number, operation:Number):void
TileMap
  
setGlobeSettings(globeSettings:GlobeSettings):void
TileMap
  
setInfoContent(content:Object):void
Function to set the content for the info window as HTML text.
TileMap
  
setInfoTitle(title:String):void
Function to set the title for the info window as HTML text.
TileMap
  
setInfoWindow(infoWindow:InfoWindow):void
TileMap
  
setKey(key:String):void
TileMap
  
setLogoPlacement(logoId:Number, pos:MapCornerPlacement):void
TileMap
  
setMapFriction(friction:Number):void
TileMap
  
setMapType(type:String):void
Function to set the map type for this map.
TileMap
  
setRolloversEnabled(benable:Boolean):void
Function to enable rollover behavior for when the mouse rolls over pois on the map.
TileMap
  
setRolloverWindow(rolloverWindow:RolloverWindow):void
TileMap
  
setSize(size:Size):void
Function to resize the map.
TileMap
  
setZoomLevel(zoom:int):void
Function to zoom the map to the specified zoom level.
TileMap
  
TileMap
  
TileMap
  
TileMap
  
updatePoi(poi:Poi, offset:IPointXY = null):void
TileMap
  
zoomIn():void
TileMap
  
zoomOut():void
TileMap
  
zoomToRect(rectLL:IRectLL, keepCenter:Boolean = false, minZoom:Number = 1, maxZoom:Number = 16):void
Function to zoom the map to the closest zoom level that fits the specified rectangle.
TileMap
Protected Methods
 MethodDefined by
  
getControls():Array
TileMap
Events
 EventSummaryDefined by
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
    TileMap
Property detail
allTilesLoadedproperty
public var allTilesLoaded:Boolean = false
allViewableTilesLoadedproperty 
public var allViewableTilesLoaded:Boolean = false
currentCursorproperty 
protected var currentCursor:int
cursorManagerproperty 
protected var cursorManager:CursorManager
EVENT_CLICKproperty 
public static var EVENT_CLICK:Number = 0
EVENT_DBLCLICKproperty 
public static var EVENT_DBLCLICK:Number = 1
EVENT_NONEproperty 
public static var EVENT_NONE:Number = -1
globeSettingsproperty 
protected var globeSettings:GlobeSettings
heightproperty 
height:Number  [read-only]Implementation
    public function get height():Number
mapIconsproperty 
protected var mapIcons:Array
OPER_RECENTERproperty 
public static var OPER_RECENTER:Number = 0
OPER_RECENTERZOOMproperty 
public static var OPER_RECENTERZOOM:Number = 1
poisproperty 
protected var pois:Array
shadowsproperty 
protected var shadows:Array
showHybproperty 
public var showHyb:Boolean = false
showMapproperty 
public var showMap:Boolean = true
showRteproperty 
public var showRte:Boolean = false
showSatproperty 
public var showSat:Boolean = false
TYPE_HYBRIDproperty 
public static var TYPE_HYBRID:String = "hyb"
TYPE_MAPproperty 
public static var TYPE_MAP:String = "map"
TYPE_SATELLITEproperty 
public static var TYPE_SATELLITE:String = "sat"
widthproperty 
width:Number  [read-only]Implementation
    public function get width():Number
zoomSettingsproperty 
protected var zoomSettings:ZoomSettings
Constructor detail
TileMap()constructor
public function TileMap(key:String, scale:int = 1, latLng:IPointLL = null, type:String = "map", mapInit:MapInit = null)

Function to add control to Map.

Parameters
key:String — key provided in MyAccount
 
scale:int (default = 1) — or zoom level (1-16)
 
latLng:IPointLL (default = null) — latitude and longitude
 
type:String (default = "map") — type ("map", "sat", "hyb")
 
mapInit:MapInit (default = null)
Method detail
addControl()method
public function addControl(control:Control, position:MapCornerPlacement = null):void

Function to add control to Map.

Parameters
control:Control — Control derived object to add to the map.
 
position:MapCornerPlacement (default = null) — position to place the control on the map.
addOverlay()method 
public function addOverlay(overlay:ShapeOverlay):void

Function to add the overlay to the map. Fires the "overlayadded" event on the map.

Parameters
overlay:ShapeOverlay — overlay to add.
addPoi()method 
public function addPoi(poi:Poi, depthType:String = "top", fireEvent:Boolean = true):void

Function to add the poi to the map. Fires the "poiadded" event on the map.

Parameters
poi:Poi — Poi New poi to add.
 
depthType:String (default = "top")
 
fireEvent:Boolean (default = true)
addRouteHighlight()method 
public function addRouteHighlight(shapeRect:IRectLL, highlightURL:String, sessionId:Object = null, bestFit:Boolean = false, keepCenter:Boolean = false, minZoom:int = 1, maxZoom:int = 16):voidParameters
shapeRect:IRectLL
 
highlightURL:String
 
sessionId:Object (default = null)
 
bestFit:Boolean (default = false)
 
keepCenter:Boolean (default = false)
 
minZoom:int (default = 1)
 
maxZoom:int (default = 16)
bestFit()method 
public function bestFit(keepCenter:Boolean = false, minZoom:int = 1, maxZoom:int = 16):voidParameters
keepCenter:Boolean (default = false)
 
minZoom:int (default = 1)
 
maxZoom:int (default = 16)
bestFitLL()method 
public function bestFitLL(arrayLL:Array, keepCenter:Boolean = false, minZoomLevel:int = 1, maxZoomLevel:int = 16):void

A function that will pan and zoom the map to "best fit" to the nearest zoom level around the points passed in.

Parameters
arrayLL:Array — array of PointLL objects.
 
keepCenter:Boolean (default = false) — 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:int (default = 1) — zoom level (default = 1).
 
maxZoomLevel:int (default = 16) — zoom level (default = 16).
enableDragging()method 
public function enableDragging(benable:Boolean):void

Function to enable/disable map dragging.

Parameters
benable:Boolean — benable true/false to set state of map dragging.
getBackgroundColor()method 
public function getBackgroundColor():Number

Returns
Number
getBestFitMargin()method 
public function getBestFitMargin():int

Returns
int
getBoundsLL()method 
public function getBoundsLL():IRectLL

Retrieves an IRectLL object for the upper-left, lower-right corners of the Map.

Returns
IRectLL
getCenter()method 
public function getCenter():IPointLL

Function to return the center of the map in geographic coordinates.

Returns
IPointLL
getCollisionInfo()method 
public function getCollisionInfo(rect:IRectXY):IPointXY

Given a rectangle determins the amount a map must be moved for no collision in display

Parameters
rect:IRectXY

Returns
IPointXY
getControls()method 
protected function getControls():Array

Returns
Array
getDeclutter()method 
public function getDeclutter():Declutter

Returns
Declutter
getDragEnabled()method 
public function getDragEnabled():Boolean

Function to return state of map dragging.

Returns
Boolean
getDragOffset()method 
public function getDragOffset():IPointXY

Returns
IPointXY
getGlobeSettings()method 
public function getGlobeSettings():GlobeSettings

Returns
GlobeSettings
getInfoWindow()method 
public function getInfoWindow():InfoWindow

Function to return a reference to the maps info window. One info window exists per map, and is repositioned over pois when clicked.

Returns
InfoWindow
getLogoPlacement()method 
public function getLogoPlacement(logoId:Number):MapCornerPlacementParameters
logoId:Number

Returns
MapCornerPlacement
getMapFriction()method 
public function getMapFriction():Number

Returns
Number
getMapType()method 
public function getMapType():String

Function to get the current map type. Possible values include:

Returns
String
getOverlays()method 
public function getOverlays():OverlayCollection

Returns
OverlayCollection
getPois()method 
public function getPois():PoiCollection

Function to return poi collection.

Returns
PoiCollection
getPrintableBitmap()method 
public function getPrintableBitmap(bitWidth:int, bitHeight:int, maintainAspectRatio:Boolean):BitmapDataParameters
bitWidth:int
 
bitHeight:int
 
maintainAspectRatio:Boolean

Returns
BitmapData
getRolloversEnabled()method 
public function getRolloversEnabled():Boolean

Function to get if rollover functionality is on.

Returns
Boolean

See also

getRolloverWindow()method 
public function getRolloverWindow():RolloverWindow

Function to return a reference to the maps rollover window. One rollover window exists per map, and is repositioned over pois when rollovers are enabled.

Returns
RolloverWindow
getSize()method 
public function getSize():Size

Function to return map size.

Returns
Size

See also

getZoomLevel()method 
public function getZoomLevel():int

Returns
int
getZoomSettings()method 
public function getZoomSettings():ZoomSettings

Returns
ZoomSettings
llToPix()method 
public function llToPix(ll:IPointLL):IPointXY

Function to convert geographical coordinates to pixel coordinates relative to the current map displayed.

Parameters
ll:IPointLL — point to get converted.

Returns
IPointXY
llToPixWithDragOffset()method 
public function llToPixWithDragOffset(ll:IPointLL):IPointXYParameters
ll:IPointLL

Returns
IPointXY
openInfoWindow()method 
public function openInfoWindow(pointXY:IPointXY):void

Function to open the info window over the map at specified pixel coordinate. The coordinate represents the spot the below the "tail" of the info window.

Parameters
pointXY:IPointXY — pixel coordinate to open the info window to.
panEast()method 
public function panEast(percent:Number):voidParameters
percent:Number
panNorth()method 
public function panNorth(percent:Number):voidParameters
percent:Number
panNorthEast()method 
public function panNorthEast(percent:Number):voidParameters
percent:Number
panNorthWest()method 
public function panNorthWest(percent:Number):voidParameters
percent:Number
panSouth()method 
public function panSouth(percent:Number):voidParameters
percent:Number
panSouthEast()method 
public function panSouthEast(percent:Number):voidParameters
percent:Number
panSouthWest()method 
public function panSouthWest(percent:Number):voidParameters
percent:Number
panToLatLng()method 
public function panToLatLng(latLng:IPointLL):void

Function to slide the mp to the new center specified. If point is greater than 100 pixels out of map boundaries the map is snapped to center, else the map will smooth srcoll to new center.

Parameters
latLng:IPointLL — new geographic center point.
panWest()method 
public function panWest(percent:Number):voidParameters
percent:Number
pixToLL()method 
public function pixToLL(xy:IPointXY, wrapAround:Boolean = true):IPointLL

Function to convert pixel coordinates to geographical coordinates relative to the current map displayed.

Parameters
xy:IPointXY — to get converted.
 
wrapAround:Boolean (default = true)

Returns
IPointLL
printMap()method 
public function printMap():void
removeAllOverlays()method 
public function removeAllOverlays():void

Function to remove all overlays from the map.

removeAllPois()method 
public function removeAllPois(fireRemoveEvents:Boolean = true):void

Function to remove the current collection of pois from the map Events are fired for each poi in the old collection when removed and a "mapcleared" event.

Parameters
fireRemoveEvents:Boolean (default = true)
removeControl()method 
public function removeControl(control:Control):void

Function to remove the control from the Map.

Parameters
control:Control — control the control to remove.
removeOverlay()method 
public function removeOverlay(overlay:ShapeOverlay):void

Function to remove the overlay from the map. Fires the "overlayremoved" event on the map.

Parameters
overlay:ShapeOverlay — overlay to be removed.
removePoi()method 
public function removePoi(poi:Poi, fireEvent:Boolean = true):void

Function to remove the poi from the map. Fires the "poiremoved" event on the map.

Parameters
poi:Poi — poi to be removed.
 
fireEvent:Boolean (default = true)
removeRouteHighlight()method 
public function removeRouteHighlight():void
replaceOverlays()method 
public function replaceOverlays(overlayCollection:OverlayCollection):void

Function to remove the current collection of overlays from the map and add the collection specified to the map. Events are fired for each overlay in the old collection when removed and a "mapcleared" event just before adding the new overlays from the new collection.

Parameters
overlayCollection:OverlayCollection — new overlay collection.
replacePois()method 
public function replacePois(poiCollection:PoiCollection):void

Function to remove the current collection of pois from the map and add the collection specified to the map. Events are fired for each poi in the old collection when removed and a "mapcleared" event just before adding the new pois from the new collection.

Parameters
poiCollection:PoiCollection — new overlay collection.
restoreState()method 
public function restoreState():void

Restores the saved map position, zoom level, and map type.

See also

saveState()method 
public function saveState():void

Stores the current map position, zoom level, and map type for later retrieval.

See also

scrollMap()method 
public function scrollMap(sx:Number, sy:Number):voidParameters
sx:Number
 
sy:Number
setBackgroundColor()method 
public function setBackgroundColor(color:Number):voidParameters
color:Number
setBestFitMargin()method 
public function setBestFitMargin(bfm:int):voidParameters
bfm:int
setCenter()method 
public function setCenter(mqLatLng:IPointLL, zoom:int = -1):void

Function to set the center of the map and optionally change the zoom level.

Parameters
mqLatLng:IPointLL — point to be the new map center.
 
zoom:int (default = -1) — new zoom level .
setCenterXY()method 
public function setCenterXY(pointXY:IPointXY):voidParameters
pointXY:IPointXY
setClickOperation()method 
public function setClickOperation(event:Number, operation:Number):voidParameters
event:Number
 
operation:Number
setGlobeSettings()method 
public function setGlobeSettings(globeSettings:GlobeSettings):voidParameters
globeSettings:GlobeSettings
setInfoContent()method 
public function setInfoContent(content:Object):void

Function to set the content for the info window as HTML text.

Parameters
content:Object — content the info window content text.
setInfoTitle()method 
public function setInfoTitle(title:String):void

Function to set the title for the info window as HTML text.

Parameters
title:String — title the info window title text.
setInfoWindow()method 
public function setInfoWindow(infoWindow:InfoWindow):voidParameters
infoWindow:InfoWindow
setKey()method 
public function setKey(key:String):voidParameters
key:String
setLogoPlacement()method 
public function setLogoPlacement(logoId:Number, pos:MapCornerPlacement):voidParameters
logoId:Number
 
pos:MapCornerPlacement
setMapFriction()method 
public function setMapFriction(friction:Number):voidParameters
friction:Number
setMapType()method 
public function setMapType(type:String):void

Function to set the map type for this map.

Parameters
type:String — type the type to change the map to. See getMapType for valid values.

See also

setRolloversEnabled()method 
public function setRolloversEnabled(benable:Boolean):void

Function to enable rollover behavior for when the mouse rolls over pois on the map. When enabled, rollover windows will display when mouse is over a poi.

Parameters
benable:Boolean — flag to enable/disable rollover functionality of map.
setRolloverWindow()method 
public function setRolloverWindow(rolloverWindow:RolloverWindow):voidParameters
rolloverWindow:RolloverWindow
setSize()method 
public function setSize(size:Size):void

Function to resize the map.

Parameters
size:Size — object containing the new height and width of the map.

See also

setZoomLevel()method 
public function setZoomLevel(zoom:int):void

Function to zoom the map to the specified zoom level. Causes a "zoomend" event to be fired on the map.

Parameters
zoom:int — level the new zoom level.
setZoomSettings()method 
public function setZoomSettings(zs:ZoomSettings):voidParameters
zs:ZoomSettings
slideMapByOffset()method 
public function slideMapByOffset(point:IPointXY):voidParameters
point:IPointXY
slideMapToPoint()method 
public function slideMapToPoint(ptxy:IPointXY):voidParameters
ptxy:IPointXY
updatePoi()method 
public function updatePoi(poi:Poi, offset:IPointXY = null):voidParameters
poi:Poi
 
offset:IPointXY (default = null)
zoomIn()method 
public function zoomIn():void
zoomOut()method 
public function zoomOut():void
zoomToRect()method 
public function zoomToRect(rectLL:IRectLL, keepCenter:Boolean = false, minZoom:Number = 1, maxZoom:Number = 16):void

Function to zoom the map to the closest zoom level that fits the specified rectangle.

Parameters
rectLL:IRectLL — rectangle to use as boundary.
 
keepCenter:Boolean (default = false) — to specify if current map center is used or center of rectangle is used for center of map.
 
minZoom:Number (default = 1) — zoom level to use even if rect needs a lower zoom level to fit.
 
maxZoom:Number (default = 16) — zoom level to use even if rect needs a higher zoom level to fit.
Event detail
alltilesloadedevent 
Event object type: com.mapquest.tilemap.TileMapEvent

clickevent  
Event object type: com.mapquest.tilemap.TileMapEvent

double_clickevent  
Event object type: com.mapquest.tilemap.TileMapEvent

dragendevent  
Event object type: com.mapquest.tilemap.TileMapEvent

infowindow_closeevent  
Event object type: com.mapquest.tilemap.TileMapEvent

infowindow_openevent  
Event object type: com.mapquest.tilemap.TileMapEvent

map_clearedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

map_type_changedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

mapresizeevent  
Event object type: com.mapquest.tilemap.TileMapEvent

moveevent  
Event object type: com.mapquest.tilemap.TileMapEvent

move_endevent  
Event object type: com.mapquest.tilemap.TileMapEvent

move_startevent  
Event object type: com.mapquest.tilemap.TileMapEvent

overlay_addedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

overlay_clickevent  
Event object type: com.mapquest.tilemap.TileMapEvent

overlay_removedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

poi_addedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

poi_removedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

viewabletilesloadedevent  
Event object type: com.mapquest.tilemap.TileMapEvent

zoom_endevent  
Event object type: com.mapquest.tilemap.TileMapEvent

zoom_startevent  
Event object type: com.mapquest.tilemap.TileMapEvent