org.gwtopenmaps.openlayers.client
Class MapOptions

java.lang.Object
  extended by org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
      extended by org.gwtopenmaps.openlayers.client.MapOptions

public class MapOptions
extends JSObjectWrapper

Map properties can be configurated by passing a MapOptions object to the MapWidget constructor. See also the Map javadoc.

Author:
Erdem Gunay, Edwin Commandeur

Constructor Summary
  MapOptions()
           
protected MapOptions(JSObject jsObject)
           
 
Method Summary
 void removeDefaultControls()
          By default, OpenLayers 2.7 adds Attribution, ArgParser, Navigation and PanZoom Controls.
 void setAllOverlays(boolean allOverlays)
          Allow the map to function with OverLays only (no BaseLayer).
 void setControls(JObjectArray controls)
           
 void setDisplayProjection(Projection projection)
          Use this method to change the display projection to another projection.
 void setMaxExtent(Bounds maxExtent)
          The upper bounds of the spatial coordinate reference system, provided in the units that CRS.
 void setMaxResolution(float maxResolution)
          See also setMaxResolutionToAuto.
 void setMaxResolutionToAuto()
          Convenience method for setting max resolution to auto.
 void setMaxScale(float maxScale)
           
 void setMinExtent(Bounds minExtent)
          The lower bounds of the spatial coordinate reference system, provided in the units that CRS.
 void setMinResolution(float minResolution)
           
 void setMinScale(float minScale)
           
 void setNumZoomLevels(int numZoomLevels)
           
 void setProjection(String projection)
          Use this method to change the default projection (EPSG:4326) to another projection.
 void setResolutions(double[] resolutions)
          For information on how OpenLayers can be configured to use different scales/resolutions, see:
http://trac.openlayers.org/wiki/SettingZoomLevels
 void setRestrictedExtent(Bounds restrictedExtent)
           
 void setTileSize(Size size)
           
 void setUnits(String units)
          The units used by the map to express geospatial coordinates.
 void setZIndexBase(ZIndexBase zIndexBase)
           
 
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
 

Constructor Detail

MapOptions

protected MapOptions(JSObject jsObject)

MapOptions

public MapOptions()
Method Detail

removeDefaultControls

public void removeDefaultControls()
By default, OpenLayers 2.7 adds Attribution, ArgParser, Navigation and PanZoom Controls. This method removes these default controls from the Map.


setNumZoomLevels

public void setNumZoomLevels(int numZoomLevels)

setAllOverlays

public void setAllOverlays(boolean allOverlays)
Allow the map to function with OverLays only (no BaseLayer).

Parameters:
allOverlays -

setControls

public void setControls(JObjectArray controls)

setProjection

public void setProjection(String projection)
Use this method to change the default projection (EPSG:4326) to another projection. See http://spatialreference.org/ for EPSG codes for projections. Properties for default projection: map.setProjection("EPSG:4326"); map.setMaxExtent(new Bounds(-180, -90, 180, 90)); Some resources explaining map projections: John P. Snyder (). Map Projections - A Working Manual ISBN-13 From the OpenLayers docs: Set in the map options to override the default projection on the map. - also set maxExtent, maxResolution, and units if appropriate.

Parameters:
projection -

setDisplayProjection

public void setDisplayProjection(Projection projection)
Use this method to change the display projection to another projection.

Parameters:
projection -

setMaxExtent

public void setMaxExtent(Bounds maxExtent)
The upper bounds of the spatial coordinate reference system, provided in the units that CRS. OR The upper bounds of the spatial data, provided in the units of the CRS in which the spatial data is served.

Parameters:
maxExtent - - a bounding rectangle

setMinExtent

public void setMinExtent(Bounds minExtent)
The lower bounds of the spatial coordinate reference system, provided in the units that CRS. OR The lower bounds of the spatial data, provided in the units of the CRS in which the spatial data is served.

Parameters:
minExtent - - a bounding rectangle

setRestrictedExtent

public void setRestrictedExtent(Bounds restrictedExtent)

setMaxResolution

public void setMaxResolution(float maxResolution)
See also setMaxResolutionToAuto. From the OpenLayers docs: Default max is 360 deg / 256 px (or 1,40625), which corresponds to zoom level 0 on gmaps.


setMinResolution

public void setMinResolution(float minResolution)

setUnits

public void setUnits(String units)
The units used by the map to express geospatial coordinates. These units should be consistent with the projection used. Use constants from the class MapUnits as input parameter. For example: setUnits(MapUnits.DEGREES); These units are also used by map controls. From the OpenLayers docs: Defaults to degrees. Possible values are: degrees (or dd), mi, ft, km, mi, inches


setMaxResolutionToAuto

public void setMaxResolutionToAuto()
Convenience method for setting max resolution to auto. ???Best option when the map can be resized?


setMaxScale

public void setMaxScale(float maxScale)

setMinScale

public void setMinScale(float minScale)

setTileSize

public void setTileSize(Size size)

setZIndexBase

public void setZIndexBase(ZIndexBase zIndexBase)

setResolutions

public void setResolutions(double[] resolutions)
For information on how OpenLayers can be configured to use different scales/resolutions, see:
http://trac.openlayers.org/wiki/SettingZoomLevels

Parameters:
resolutions - -array of resolutions


Copyright © 2011 sourceforge. All Rights Reserved.