com.googlecode.gwtmapquest.transaction
Class MQATileMap

java.lang.Object
  extended by JavaScriptObject
      extended by com.googlecode.gwtmapquest.transaction.MQATileMap
All Implemented Interfaces:
HasInfoWindowCloseHandlers, HasInfoWindowOpenHandlers, HasMapClearedHandlers, HasMapTypeChangedHandlers, HasMoveEndHandlers, HasMoveHandlers, HasMoveStartHandlers, HasShapeAddedHandlers, HasShapeRemovedHandlers, HasZoomEndHandlers

public class MQATileMap
extends JavaScriptObject
implements HasInfoWindowCloseHandlers, HasInfoWindowOpenHandlers, HasMapClearedHandlers, HasMapTypeChangedHandlers, HasMoveEndHandlers, HasMoveHandlers, HasMoveStartHandlers, HasShapeAddedHandlers, HasShapeRemovedHandlers, HasZoomEndHandlers

MQ API reference is here


Field Summary
static java.lang.String TYPE_HYP
           
static java.lang.String TYPE_MAP
           
static java.lang.String TYPE_SAT
           
 
Constructor Summary
protected MQATileMap()
           
 
Method Summary
 void addControl(MQAControl control)
           
 void addInfoWindowCloseHandler(InfoWindowCloseHandler handler)
           
 void addInfoWindowOpenHandler(InfoWindowOpenHandler handler)
           
 void addMapClearedHandler(MapClearedHandler handler)
           
 void addMapTypeChangedHandler(MapTypeChangedHandler handler)
           
 void addMoveEndHandler(MoveEndHandler handler)
           
 void addMoveHandler(MoveHandler handler)
           
 void addMoveStartHandler(MoveStartHandler handler)
           
 void addRouteHighlight(MQARectLL boundingBox, java.lang.String mapServerUrl, java.lang.String sessionID, boolean bestFit)
           
 void addShape(MQAAbstractShape point)
          Adds the specified shape to the map.
 void addShapeAddedHandler(ShapeAddedHandler handler)
           
 void addShapeCollection(MQAShapeCollection points)
           
 void addShapeRemovedHandler(ShapeRemovedHandler handler)
           
 void addShapes(MQAShapeCollection points)
          Adds the specified shape collection's shapes to the map's default collection
 void addZoomEndHandler(ZoomEndHandler handler)
           
 void bestFit()
           
 void bestFit(boolean keepCenter)
           
 void bestFit(boolean keepCenter, int minZoomLevel)
           
 void bestFit(boolean keepCenter, int minZoomLevel, int maxZoomLevel)
           
 void bestFitLL( latLngArray)
           
 void bestFitLL( latLngArray, boolean keepCenter)
           
 void bestFitLL( latLngArray, boolean keepCenter, int minZoomLevel)
           
 void bestFitLL( latLngArray, boolean keepCenter, int minZoomLevel, int maxZoomLevel)
           
 int getBestFitMargin()
           
 MQARectLL getBounds()
           
 MQAPoi getByKey(java.lang.String key)
           
 MQALatLng getCenter()
           
 MQADeclutter getDeclutter()
           
 boolean getDragEnabled()
           
 MQAPoint getDragOffset()
           
 MQAInfoWindow getInfoWindow()
           
 boolean getMapShadowState()
           
 java.lang.String getMapType()
           
 boolean getRolloversEnabled()
           
 MQARolloverWindow getRolloverWindow()
           
 java.lang.String getRouteSession()
           
 int getScale()
          Returns the current scale of the map based on zoom level.
 MQAShapeCollection getShapeCollection(java.lang.String name)
           
 int getShapeCollectionCount()
           
 JsArrayString getShapeCollectionNames()
           
  getShapeCollections()
           
 MQAShapeCollection getShapes(boolean onlyPois)
           
 MQASize getSize()
           
 int getZoomLevel()
           
 void hideStaticMap()
           
 MQAPoint llToPix(MQALatLng point)
          Function to convert geographical coordinates to pixel coordinates relative to the current map displayed.
static MQATileMap newInstance(Element container)
           
static MQATileMap newInstance(Element container, int zoomLevel, MQALatLng center, java.lang.String mapType)
           
 void openInfoWindow(MQAPoint point)
           
 void panEast(int percentage)
           
 void panNorth(int percentage)
           
 void panNorthEast(int percentage)
           
 void panNorthWest(int percentage)
           
 void panSouth(int percentage)
           
 void panSouthEast(int percentage)
           
 void panSouthWest(int percentage)
           
 void panToLatLng(MQALatLng latLng)
           
 void panWest(int percentage)
           
 MQALatLng pixToLL(MQAPoint point)
          Converts pixel coordinates to geographical coordinates relative to the current map displayed.
 void removeAllShapes()
          Removes all shapes from the map's default collection.
 void removeControl(MQAControl control)
           
 void removeRouteHighlight()
           
 void removeShape(MQAAbstractShape shape)
          Removes the specified shape from the map's default collection.
 void removeShapeCollection(java.lang.String collectionName)
           
 boolean replaceShapeCollection(MQAShapeCollection newCollection, java.lang.String nameOfOldCollection)
           
 boolean replaceShapes(MQAShapeCollection newCollection)
          Replaces the shapes in the map's current default collection with the shapes in the specified collection.
 void restoreState()
           
 void saveState()
           
 void setBestFitMargin(int marginPixels)
           
 void setCenter(MQALatLng centerLatLng)
           
 void setCenter(MQALatLng centerLatLng, int newZoomLevel)
           
 void setDragEnabled(boolean enabled)
           
 void setInfoContentElement(Element contentContainer)
           
 void setInfoContentHTML(java.lang.String content)
           
 void setInfoTitleElement(Element element)
           
 void setInfoTitleHTML(java.lang.String title)
           
 void setMapShadowState(boolean showShadows)
           
 void setMapType(java.lang.String type)
           
 void setRolloversEnabled(boolean enabled)
           
 void setSize()
           
 void setSize(MQASize size)
           
 void setZoomLevel(int level)
          Zoom the map to the specified zoom level.
 void showStaticMap()
           
 void zoomIn()
           
 void zoomOut()
           
 void zoomToRect(MQARectLL boundary)
          Zoom the map to the closest zoom level that fits the specified rectangle.
 void zoomToRect(MQARectLL boundary, boolean keepCenter)
          Zoom the map to the closest zoom level that fits the specified rectangle.
 void zoomToRect(MQARectLL boundary, boolean keepCenter, int minZoom)
          Zoom the map to the closest zoom level that fits the specified rectangle.
 void zoomToRect(MQARectLL boundary, boolean keepCenter, int minZoom, int maxZoom)
          Zoom the map to the closest zoom level that fits the specified rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_MAP

public static final java.lang.String TYPE_MAP
See Also:
Constant Field Values

TYPE_SAT

public static final java.lang.String TYPE_SAT
See Also:
Constant Field Values

TYPE_HYP

public static final java.lang.String TYPE_HYP
See Also:
Constant Field Values
Constructor Detail

MQATileMap

protected MQATileMap()
Method Detail

newInstance

public static MQATileMap newInstance(Element container)

newInstance

public static MQATileMap newInstance(Element container,
                                     int zoomLevel,
                                     MQALatLng center,
                                     java.lang.String mapType)

addControl

public final void addControl(MQAControl control)

removeControl

public final void removeControl(MQAControl control)

addShape

public final void addShape(MQAAbstractShape point)
Adds the specified shape to the map. Fires the 'MQA.TileMap.shapeAdded' event.

Parameters:
point -

addShapes

public final void addShapes(MQAShapeCollection points)
Adds the specified shape collection's shapes to the map's default collection

Parameters:
points -

removeShape

public final void removeShape(MQAAbstractShape shape)
Removes the specified shape from the map's default collection. Fires the 'MQA.TileMap.shapeRemoved' event.

Parameters:
shape -

replaceShapes

public final boolean replaceShapes(MQAShapeCollection newCollection)
Replaces the shapes in the map's current default collection with the shapes in the specified collection. Events are fired for each shape removed from the old collection and for each shape added from the new collection. A 'mapcleared' event also fires before adding the new shapes.

Parameters:
newCollection -
Returns:

removeAllShapes

public final void removeAllShapes()
Removes all shapes from the map's default collection. Fires the 'mapcleared' event.


getCenter

public final MQALatLng getCenter()

setCenter

public final void setCenter(MQALatLng centerLatLng)

setCenter

public final void setCenter(MQALatLng centerLatLng,
                            int newZoomLevel)

getDragOffset

public final MQAPoint getDragOffset()

getMapType

public final java.lang.String getMapType()

setMapType

public final void setMapType(java.lang.String type)
Parameters:
type - The map type to set. Valid values are 'map', 'sat', and 'hyb'.

pixToLL

public final MQALatLng pixToLL(MQAPoint point)
Converts pixel coordinates to geographical coordinates relative to the current map displayed.

Parameters:
point -
Returns:

llToPix

public final MQAPoint llToPix(MQALatLng point)
Function to convert geographical coordinates to pixel coordinates relative to the current map displayed.

Parameters:
point -
Returns:

zoomIn

public final void zoomIn()

zoomOut

public final void zoomOut()

getZoomLevel

public final int getZoomLevel()

setZoomLevel

public final void setZoomLevel(int level)
Zoom the map to the specified zoom level. Causes a 'MQA.TileMap.zoomEnd' event to be fired on the map.

Parameters:
level -

zoomToRect

public final void zoomToRect(MQARectLL boundary)
Zoom the map to the closest zoom level that fits the specified rectangle.

Parameters:
boundary -

zoomToRect

public final void zoomToRect(MQARectLL boundary,
                             boolean keepCenter)
Zoom the map to the closest zoom level that fits the specified rectangle.

Parameters:
boundary -
keepCenter -

zoomToRect

public final void zoomToRect(MQARectLL boundary,
                             boolean keepCenter,
                             int minZoom)
Zoom the map to the closest zoom level that fits the specified rectangle.

Parameters:
boundary -
keepCenter -
minZoom -

zoomToRect

public final void zoomToRect(MQARectLL boundary,
                             boolean keepCenter,
                             int minZoom,
                             int maxZoom)
Zoom the map to the closest zoom level that fits the specified rectangle.

Parameters:
boundary -
keepCenter -
minZoom -
maxZoom -

getScale

public final int getScale()
Returns the current scale of the map based on zoom level.

Returns:

bestFit

public final void bestFit()

bestFit

public final void bestFit(boolean keepCenter)

bestFit

public final void bestFit(boolean keepCenter,
                          int minZoomLevel)

bestFit

public final void bestFit(boolean keepCenter,
                          int minZoomLevel,
                          int maxZoomLevel)

bestFitLL

public final void bestFitLL( latLngArray)

bestFitLL

public final void bestFitLL( latLngArray,
                            boolean keepCenter)

bestFitLL

public final void bestFitLL( latLngArray,
                            boolean keepCenter,
                            int minZoomLevel)

bestFitLL

public final void bestFitLL( latLngArray,
                            boolean keepCenter,
                            int minZoomLevel,
                            int maxZoomLevel)

panToLatLng

public final void panToLatLng(MQALatLng latLng)

getRolloverWindow

public final MQARolloverWindow getRolloverWindow()

getInfoWindow

public final MQAInfoWindow getInfoWindow()

setInfoTitleHTML

public final void setInfoTitleHTML(java.lang.String title)

setInfoContentHTML

public final void setInfoContentHTML(java.lang.String content)

setInfoTitleElement

public final void setInfoTitleElement(Element element)

setInfoContentElement

public final void setInfoContentElement(Element contentContainer)

openInfoWindow

public final void openInfoWindow(MQAPoint point)

setRolloversEnabled

public final void setRolloversEnabled(boolean enabled)

getRolloversEnabled

public final boolean getRolloversEnabled()

setDragEnabled

public final void setDragEnabled(boolean enabled)

getDragEnabled

public final boolean getDragEnabled()

getShapes

public final MQAShapeCollection getShapes(boolean onlyPois)

getSize

public final MQASize getSize()

setSize

public final void setSize()

setSize

public final void setSize(MQASize size)

addRouteHighlight

public final void addRouteHighlight(MQARectLL boundingBox,
                                    java.lang.String mapServerUrl,
                                    java.lang.String sessionID,
                                    boolean bestFit)

removeRouteHighlight

public final void removeRouteHighlight()

getRouteSession

public final java.lang.String getRouteSession()

getBounds

public final MQARectLL getBounds()

restoreState

public final void restoreState()

saveState

public final void saveState()

getDeclutter

public final MQADeclutter getDeclutter()

showStaticMap

public final void showStaticMap()

hideStaticMap

public final void hideStaticMap()

setBestFitMargin

public final void setBestFitMargin(int marginPixels)

getBestFitMargin

public final int getBestFitMargin()

panNorth

public final void panNorth(int percentage)

panSouth

public final void panSouth(int percentage)

panEast

public final void panEast(int percentage)

panWest

public final void panWest(int percentage)

panNorthWest

public final void panNorthWest(int percentage)

panSouthWest

public final void panSouthWest(int percentage)

panNorthEast

public final void panNorthEast(int percentage)

panSouthEast

public final void panSouthEast(int percentage)

addShapeCollection

public final void addShapeCollection(MQAShapeCollection points)

removeShapeCollection

public final void removeShapeCollection(java.lang.String collectionName)

replaceShapeCollection

public final boolean replaceShapeCollection(MQAShapeCollection newCollection,
                                            java.lang.String nameOfOldCollection)

getShapeCollection

public final MQAShapeCollection getShapeCollection(java.lang.String name)

getShapeCollections

public final  getShapeCollections()

getShapeCollectionNames

public final JsArrayString getShapeCollectionNames()
Returns:
an array of all the shape collection names (Strings) currently on the map.

getShapeCollectionCount

public final int getShapeCollectionCount()

setMapShadowState

public final void setMapShadowState(boolean showShadows)

getMapShadowState

public final boolean getMapShadowState()

getByKey

public final MQAPoi getByKey(java.lang.String key)

addInfoWindowCloseHandler

public final void addInfoWindowCloseHandler(InfoWindowCloseHandler handler)
Specified by:
addInfoWindowCloseHandler in interface HasInfoWindowCloseHandlers

addInfoWindowOpenHandler

public final void addInfoWindowOpenHandler(InfoWindowOpenHandler handler)
Specified by:
addInfoWindowOpenHandler in interface HasInfoWindowOpenHandlers

addShapeAddedHandler

public final void addShapeAddedHandler(ShapeAddedHandler handler)
Specified by:
addShapeAddedHandler in interface HasShapeAddedHandlers

addShapeRemovedHandler

public final void addShapeRemovedHandler(ShapeRemovedHandler handler)
Specified by:
addShapeRemovedHandler in interface HasShapeRemovedHandlers

addMapClearedHandler

public final void addMapClearedHandler(MapClearedHandler handler)
Specified by:
addMapClearedHandler in interface HasMapClearedHandlers

addMapTypeChangedHandler

public final void addMapTypeChangedHandler(MapTypeChangedHandler handler)
Specified by:
addMapTypeChangedHandler in interface HasMapTypeChangedHandlers

addMoveEndHandler

public final void addMoveEndHandler(MoveEndHandler handler)
Specified by:
addMoveEndHandler in interface HasMoveEndHandlers

addMoveHandler

public final void addMoveHandler(MoveHandler handler)
Specified by:
addMoveHandler in interface HasMoveHandlers

addMoveStartHandler

public final void addMoveStartHandler(MoveStartHandler handler)
Specified by:
addMoveStartHandler in interface HasMoveStartHandlers

addZoomEndHandler

public final void addZoomEndHandler(ZoomEndHandler handler)
Specified by:
addZoomEndHandler in interface HasZoomEndHandlers