|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.Container
com.gwtext.client.widgets.Panel
com.gwtext.client.widgets.map.MapPanel
public abstract class MapPanel
Base Map Panel for various map providers. This class adds support for the Mapstraction library.
Mapstraction is a library that provides a common API for various mapping APIs to enable switching from one to another as smoothly as possible. Developers can code their applications once, and then easily switch mapping provider based on project needs, terms and conditions, and new functionality. Users can switch maps as desired based on personal taste and quality of maps in their local area. Various tools built on top of Mapstraction allow users to easily integrate maps into their own sites, and configure them with different controls, styles, and provider.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
static com.gwtext.client.widgets.map.MapPanel.FilterOperator |
GE
|
static com.gwtext.client.widgets.map.MapPanel.MapType |
HYBRID
|
static com.gwtext.client.widgets.map.MapPanel.FilterOperator |
LE
|
static java.lang.String |
MAP_RENDERED_EVENT
|
protected com.google.gwt.core.client.JavaScriptObject |
mapJS
|
static com.gwtext.client.widgets.map.MapPanel.MapType |
ROAD
|
static com.gwtext.client.widgets.map.MapPanel.MapType |
SATELLITE
|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
MapPanel()
Create a new MapPanel. |
Method Summary | |
---|---|
void |
add(Component component)
Add a component to this Panel. |
void |
add(Component component,
int top,
int right)
Add an absolutely positioned component over the map panel at the specificed location. |
void |
addEventListener(java.lang.String event,
Function listener)
|
void |
addFilter(java.lang.String field,
com.gwtext.client.widgets.map.MapPanel.FilterOperator operator,
double value)
Adds a marker filter. |
void |
addFilter(java.lang.String field,
com.gwtext.client.widgets.map.MapPanel.FilterOperator operator,
int value)
Adds a marker filter. |
void |
addFilter(java.lang.String field,
com.gwtext.client.widgets.map.MapPanel.FilterOperator operator,
java.lang.String value)
Adds a marker filter. |
void |
addImageOverlay(java.lang.String id,
java.lang.String imageURL,
int opacity,
double west,
double south,
double east,
double north)
Layers an georeferenced image over the map. |
void |
addLargeControls()
Adds a large map panning control and zoom buttons to the map. |
void |
addMapTypeControls()
Adds a map type control to the map (streets, aerial imagery etc) Supported by: yahoo, google, openstreetmap, multimap, mapquest. |
void |
addMarker(Marker marker)
Adds a marker pin to the map. |
void |
addOverlay(java.lang.String overlayURL)
Adds a GeoRSS or KML overlay to the map. |
void |
addOverlay(java.lang.String overlayURL,
boolean autoCenterAndZoom)
Adds a GeoRSS or KML overlay to the map. |
void |
addPolyline(Polyline polyline)
Adds a polyline to the map. |
void |
addSmallControls()
Adds a small map panning control and zoom buttons to the map. |
protected void |
afterRender()
Template method that is called after the Component has been renedered. |
void |
autoCenterAndZoom()
Sets the center and zoom of the map to the smallest bounding box containing all markers |
void |
doFilter()
Executes all filters added since last call |
protected abstract com.google.gwt.core.client.JavaScriptObject |
doRenderMap(com.google.gwt.user.client.Element element)
|
void |
doResize()
|
BoundingBox |
getBounds()
The maps bounding box. |
LatLonPoint |
getCenter()
The center of the map. |
com.google.gwt.core.client.JavaScriptObject |
getMap()
Return the native map object. |
int |
getZoom()
The zoom level of the map. |
int |
getZoomLevelForBoundingBox(BoundingBox boundingBox)
This method should be called only after the map has been rendered. |
protected void |
initComponent()
This template method is called after the Component has been instantiated but before it's rendered. |
boolean |
isMapRendered()
|
void |
removeAllMarkers()
This method should be called only after the map has been rendered. |
void |
removeAllPolylines()
This method should be called only after the map has been rendered. |
void |
removeMarker(Marker marker)
This method should be called only after the map has been rendered. |
void |
removePolyline(Polyline polyline)
This method should be called only after the map has been rendered. |
void |
resizeTo(int width,
int height)
This method should be called only after the map has been rendered. |
void |
setCenterAndZoom(LatLonPoint latLonPoint,
int zoom)
|
void |
setDragging(boolean dragging)
Enable/disable dragging of the map (only implemented for yahoo and google) Supported by: yahoo, google, openstreetmap, multimap. |
void |
setHeight(int height)
The height of this component in pixels (defaults to auto). |
void |
setMapType(com.gwtext.client.widgets.map.MapPanel.MapType mapType)
Sets the imagery type for the map. |
void |
setWidth(int width)
The component width. |
Methods inherited from class com.gwtext.client.widgets.Container |
---|
add, add, add, addListener, bubble, cascade, clear, doLayout, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject mapJS
public static final java.lang.String MAP_RENDERED_EVENT
public static com.gwtext.client.widgets.map.MapPanel.FilterOperator GE
public static com.gwtext.client.widgets.map.MapPanel.FilterOperator LE
public static com.gwtext.client.widgets.map.MapPanel.MapType ROAD
public static com.gwtext.client.widgets.map.MapPanel.MapType SATELLITE
public static com.gwtext.client.widgets.map.MapPanel.MapType HYBRID
Constructor Detail |
---|
public MapPanel()
Method Detail |
---|
public boolean isMapRendered()
protected void afterRender()
Component
afterRender
in class Component
protected void initComponent()
Component
initComponent
in class Component
protected abstract com.google.gwt.core.client.JavaScriptObject doRenderMap(com.google.gwt.user.client.Element element)
public void setWidth(int width)
BoxComponent
setWidth
in class BoxComponent
width
- the width, -1 for autopublic void setHeight(int height)
BoxComponent
setHeight
in class BoxComponent
height
- the component heightpublic void doResize()
public void addEventListener(java.lang.String event, Function listener)
public void addFilter(java.lang.String field, com.gwtext.client.widgets.map.MapPanel.FilterOperator operator, java.lang.String value)
field
- the name of attribute to filter onoperator
- the filter operatorvalue
- the value to compare againstpublic void addFilter(java.lang.String field, com.gwtext.client.widgets.map.MapPanel.FilterOperator operator, int value)
field
- the name of attribute to filter onoperator
- the filter operatorvalue
- the value to compare againstpublic void addFilter(java.lang.String field, com.gwtext.client.widgets.map.MapPanel.FilterOperator operator, double value)
field
- the name of attribute to filter onoperator
- the filter operatorvalue
- the value to compare againstpublic void addOverlay(java.lang.String overlayURL)
overlayURL
- adds a GeoRSS or KML overlay to the mappublic void setMapType(com.gwtext.client.widgets.map.MapPanel.MapType mapType)
mapType
- the map typepublic void addOverlay(java.lang.String overlayURL, boolean autoCenterAndZoom)
overlayURL
- adds a GeoRSS or KML overlay to the mapautoCenterAndZoom
- true to auto center and zoom after the feed is loadedpublic void addImageOverlay(java.lang.String id, java.lang.String imageURL, int opacity, double west, double south, double east, double north)
id
- unique ID of the image overlayimageURL
- url of imageopacity
- 0-100west
- the west boundarysouth
- the south boundaryeast
- the east boundarynorth
- the north boundarypublic void addLargeControls()
public void addMapTypeControls()
public void addMarker(Marker marker)
marker
- the marker to addpublic void addPolyline(Polyline polyline)
polyline
- the polyline to addpublic void addSmallControls()
public void autoCenterAndZoom()
public void doFilter()
public void setDragging(boolean dragging)
dragging
- true to enable draggingpublic BoundingBox getBounds()
public LatLonPoint getCenter()
public com.google.gwt.core.client.JavaScriptObject getMap()
public int getZoom()
public int getZoomLevelForBoundingBox(BoundingBox boundingBox)
boundingBox
- the bounding box
public void removeMarker(Marker marker)
public void removeAllMarkers()
public void removePolyline(Polyline polyline)
public void removeAllPolylines()
public void resizeTo(int width, int height)
width
- thw widthheight
- the heightpublic void setCenterAndZoom(LatLonPoint latLonPoint, int zoom)
public void add(Component component)
add
in class Container
component
- the component to addpublic void add(Component component, int top, int right)
component
- the component to addtop
- the top coordinateright
- the right coordinate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |