|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gwtopenmaps.openlayers.client.util.JSObjectWrapper
org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper
org.gwtopenmaps.openlayers.client.Map
public class Map
The Map class is the hub of OpenLayers. Instances of the Map class are "interactive maps embedded in a webpage". In GWT-OpenLayers the map is wrapped in a MapWidget which is a GWT Widget. GWT Widgets can receive events from the browser and can be added to GWT Panels.
MapWidget mapWidget = new MapWidget("100%", "100%");
Map map = mapWidget.getMap(); //instantiates map
map.setControls(new LayerSwitcher());
Or
MapOptions options = new MapOptions();
options.setControls(new LayerSwitcher());
MapWidget mapWidget = new MapWidget("100%", "100%", options);
Map map = mapWidget.getMap(); //instantiates map
Adjusted from OL API docs:
On their own maps do not provide much functionality. To extend a map
it's necessary to add controls, see Control
and layers, see Layer
to the map.
| Field Summary |
|---|
| Fields inherited from class org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper |
|---|
eventListeners |
| Method Summary | |
|---|---|
void |
addControl(Control control)
|
void |
addLayer(Layer layer)
|
void |
addLayers(Layer[] layers)
|
void |
addMapBaseLayerChangedListener(MapBaseLayerChangedListener listener)
|
void |
addMapClickListener(MapClickListener listener)
|
void |
addMapLayerAddedListener(MapLayerAddedListener listener)
|
void |
addMapLayerChangedListener(MapLayerChangedListener listener)
|
void |
addMapLayerRemovedListener(MapLayerRemovedListener listener)
|
void |
addMapMarkerAddedListener(MapMarkerAddedListener listener)
|
void |
addMapMarkerRemovedListener(MapMarkerRemovedListener listener)
|
void |
addMapMoveListener(MapMoveListener listener)
|
void |
addMapPopupClosedListener(MapPopupClosedListener listener)
|
void |
addMapPopupOpenedListener(MapPopupOpenedListener listener)
|
void |
addMapZoomListener(MapZoomListener listener)
|
void |
addPopup(Popup popup)
|
void |
addPopupExclusive(Popup popup)
Closes all other popups first |
void |
destroy()
|
boolean |
getAllOverlays()
|
LonLat |
getCenter()
|
Bounds |
getExtent()
|
Layer |
getLayer(java.lang.String id)
Get a layer based on the id assigned by OpenLayers. |
Layer |
getLayerByName(java.lang.String name)
This is not an OpenLayers native function. |
int |
getLayerIndex(Layer layer)
|
Layer[] |
getLayers()
|
Layer[] |
getLayersByName(java.lang.String name)
|
LonLat |
getLonLatFromPixel(Pixel pixel)
|
Bounds |
getMaxExtent()
|
double |
getMaxResolution()
|
int |
getNumLayers()
|
Pixel |
getPixelFromLonLat(LonLat lonlat)
|
java.lang.String |
getProjection()
|
double |
getResolution()
|
double |
getResolutionForZoom()
|
double |
getScale()
|
Size |
getSize()
|
Size |
getTileSize()
|
java.lang.String |
getUnits()
See also MapUnits. |
int |
getZoom()
Returns current zoom level of map object. |
int |
getZoomForExtent(Bounds bounds,
boolean closest)
|
static Map |
narrowToMap(JSObject object)
|
void |
panTo(LonLat lonlat)
|
void |
raiseLayer(Layer layer,
int delta)
|
void |
removeControl(Control control)
|
void |
removeLayer(Layer layer)
|
void |
removeOverlayLayers()
This is not an OpenLayers native function. |
void |
removePopup(Popup popup)
|
void |
setBaseLayer(Layer newBaseLayer)
|
void |
setCenter(LonLat lonlat)
|
void |
setCenter(LonLat lonlat,
int zoom)
|
void |
setFractionalZoom(boolean fractionalZoom)
Somehow this is not an API property in OL, but it seems it would make sense as an API property and it is well documented: |
void |
setLayerIndex(Layer layer,
int index)
|
void |
setMaxExtent(Bounds extent)
|
void |
setMinExtent(Bounds extent)
|
void |
setOptions(MapOptions mapOptions)
|
void |
setRestrictedExtent(Bounds extent)
|
void |
updateSize()
This function should be called by any external code which dynamically changes the size of the map div. |
void |
zoomTo(int zoomLevel)
|
void |
zoomToExtent(Bounds bounds)
|
void |
zoomToMaxExtent()
|
| Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper |
|---|
getListeners, narrowToOpenLayersEObjectWrapper, removeListener |
| Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper |
|---|
getClassName, getEvents, narrowToOpenLayersObjectWrapper |
| Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper |
|---|
getJSObject, setJSObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Map narrowToMap(JSObject object)
public LonLat getCenter()
public void setCenter(LonLat lonlat)
public void setCenter(LonLat lonlat,
int zoom)
public void addControl(Control control)
public void addLayer(Layer layer)
public void addLayers(Layer[] layers)
public void addPopup(Popup popup)
public void addPopupExclusive(Popup popup)
public void removePopup(Popup popup)
public int getNumLayers()
public Layer getLayer(java.lang.String id)
Layer can be asked for it's id. This id can be used
to get at the layer within the application.
id - - String identifier assigned by OpenLayers
public Layer[] getLayers()
public void removeLayer(Layer layer)
public void removeControl(Control control)
public int getLayerIndex(Layer layer)
public void setLayerIndex(Layer layer,
int index)
public Layer getLayerByName(java.lang.String name)
name - - the name of a layer or part of it
public Layer[] getLayersByName(java.lang.String name)
name - - the name of a layer or part of it
public void removeOverlayLayers()
public void zoomToExtent(Bounds bounds)
public int getZoomForExtent(Bounds bounds,
boolean closest)
public int getZoom()
public LonLat getLonLatFromPixel(Pixel pixel)
public Pixel getPixelFromLonLat(LonLat lonlat)
public java.lang.String getProjection()
public java.lang.String getUnits()
MapUnits.
public Bounds getExtent()
public Bounds getMaxExtent()
public double getResolution()
public double getScale()
public void raiseLayer(Layer layer,
int delta)
public void zoomTo(int zoomLevel)
public void zoomToMaxExtent()
public void setOptions(MapOptions mapOptions)
public void panTo(LonLat lonlat)
public Size getTileSize()
public Size getSize()
public double getMaxResolution()
public double getResolutionForZoom()
public void setFractionalZoom(boolean fractionalZoom)
Somehow this is not an API property in OL, but it seems it would make sense as an API property and it is well documented:
For a base layer that supports it, allow the map resolution to be set to a value between one of the values in the resolutions array. Default is false. When fractionalZoom is set to true, it is possible to zoom to an arbitrary extent. This requires a base layer from a source that supports requests for arbitrary extents (i.e. not cached tiles on a regular lattice). This means that fractionalZoom will not work with commercial layers (Google, Yahoo, VE), layers using TileCache, or any other pre-cached data sources. If you are using fractionalZoom, then you should also use getResolutionForZoom instead of layer.resolutions[zoom] as the former works for non-integer zoom levels.
public void setMinExtent(Bounds extent)
public void setMaxExtent(Bounds extent)
public void setRestrictedExtent(Bounds extent)
public boolean getAllOverlays()
public void setBaseLayer(Layer newBaseLayer)
public void updateSize()
public void destroy()
public void addMapBaseLayerChangedListener(MapBaseLayerChangedListener listener)
public void addMapLayerAddedListener(MapLayerAddedListener listener)
public void addMapLayerChangedListener(MapLayerChangedListener listener)
public void addMapLayerRemovedListener(MapLayerRemovedListener listener)
public void addMapMoveListener(MapMoveListener listener)
public void addMapZoomListener(MapZoomListener listener)
public void addMapMarkerAddedListener(MapMarkerAddedListener listener)
public void addMapMarkerRemovedListener(MapMarkerRemovedListener listener)
public void addMapPopupOpenedListener(MapPopupOpenedListener listener)
public void addMapPopupClosedListener(MapPopupClosedListener listener)
public void addMapClickListener(MapClickListener listener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||