OpenLayers.Map Instantiate class {OpenLayers.Map} in order to create a map. This is the central class in the API. Everything else is auxiliary. * Constructor OpenLayers.Map(container, opts?) -- Creates a new map inside of the given HTML container, which is typically a DIV element. The opts variable is an object with various options, as described in the options section below. * Methods * Layer Management addLayer({OpenLayers.Layer|layer}) -- none -- adds a layer to the list currently set for the map. addLayers([ {OpenLayers.Layer|layer}, {OpenLayers.Layer|layer} ]) -- none -- Adds multiple layers to a map. removeLayer({OpenLayers.Layer|layer}) -- none -- Remove a layer from the map. setBaseLayer({OpenLayers.Layer|layer}) -- none -- Sets a new base layer for the map. The provided layer should have already been added to the map. Changing the base layer causes all other base layers to be turned off, and all overlays to reproject themselves. * Control Management addControl({OpenLayers.Control|control}) -- none -- Adds a control to the map. * Popup Management addPopup({OpenLayers.Popup|popup}, {Boolean|exclusive}) -- none -- adds a popup to the map. If exclusive is set to true, then all other popups are closed first. removePopup({OpenLayers.Popup|popup}) -- none -- removes an existing popup from the map. * Center management setCenter({OpenLayers.LonLat|lonlat}, {int|zoom}) -- none -- Set the center point of the map. This then moves all the layers to the new center location as well, using each layer's 'moveTo' function. The 'zoom' is an integer from 0 to maxZoomLevel. pan({Integer|dx}, {Integer|dy}) -- none -- Allows user to pan by a value of screen pixels * Zoom Management zoomTo({int|zoom}) -- none -- zoom to the given zoom level. zoomIn() -- none -- zoom in one level. zoomOut() -- none -- zoom out one level. zoomToExtent({OpenLayers.Bounds|bounds}) -- none -- Set the map such that the bounds fits within the current viewport area. zoomToMaxExtent() -- none -- Zoom such that the entire bounds of the map is contained in the viewport. zoomToScale({float}) -- none -- Zoom as close to the given scale as possible. Scale can be given as a ratio (1/24000) or as the denominator of the scale value (24000). zoomToScale will find the zoom level which most closely fits the requested scale and set that as the current zoom level. * Current Map Information getLonLatFromPixel({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns OpenLayers.LonLat corresponding to the given OpenLayers.Pixel, translated into lon/lat by the current base layer getPixelFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns OpenLayers.Pixel corresponding to the given OpenLayers.LonLat, translated by the current base layer getCenter() -- {OpenLayers.LonLat} -- Returns a LonLat for the current center of the map getZoom() -- {Integer} -- Returns the current zoom level as an integer getExtent() -- {OpenLayers.Bounds} -- Returns a Bounds object which represents the geographic bounds of the current viewPort. getSize() -- {OpenLayers.Pixel} -- Returns the pixel size of the current map window. getTileSize() -- {OpenLayers.Size} -- Returns tile size currently set for map. getResolution() -- {float} -- Returns the current resolution (units/pixel) of the map getZoomForExtent({OpenLayers.Bounds|bounds}) -- Zoom level in which the given bounds will fit -- zooming to this level and setting the center of the map in the center of the bounds will always fit the given bounds in the map. * Default Map Information getMaxResolution() -- {float} -- returns The Map's Maximum Resolution, the units/pixel at zoom level 0. The default is 1.40625, to match the approximate MaxResolution used by the commercial providers. getMaxExtent() -- {OpenLayers.Bounds} -- Return the max extent of the current base layer as defined on the layer. The default maxExtent for OpenLayers is -180,-90,180,90 getMaxZoomLevel() -- {int} -- Returns the maximum zoom level that can be reached in the map for the current base layer getMinZoomLevel() -- {int} -- Returns the minimum zoom level that can be reached in the map for the current base layer * Events addlayer -- a layer is added to the map removelayer -- a layer is removed from the map changelayer -- a layer has some property of it, typically visibility, changed. changebaselayer -- the current base layer changes movestart -- start of a movement in the map zoomend -- end of a zoom action mouseover -- map is moused over mouseout -- map is no longer mousedout mousemove -- mouse moves inside map dragstart -- drag action starts dragend -- drag action ends * Options: * controls -- an array of control objects to be added to the map. The default is [new OpenLayers.Control.MouseDefaults(), new OpenLayers.Control.PanZoom()] * projection -- used by WMS layers, should be an SRS identifier. * maxZoomLevel -- The number of zoom levels to use in the map. * maxExtent -- {OpenLayers.Bounds} to be used as the maximum extent of a map. The center of the map can not leave the maxExtent of the map when dragging. * maxResolution -- The units/pixel measurement at zoom level 0. Default is 1.40625 * resolutions -- An array of resolutions to be used as an index when zooming. Overrides maxZoomLevel and maxResolution if present. * minScale -- The smallest scale value. minScale is preferred over maxResolution, if present. * maxScale -- The maximum scale the map should include. Overrides maxZoomLevel if present. * units -- The units of the map. Defaults to degrees. Neccesary when using scale in any way. * scales -- An array of scale values. Overrides maxResolution, maxZoomLevel, resolutions, and min/max scale if present.