1
|
OpenLayers.Layer
|
2
|
|
3
|
Layers are the most important and central aspect of OpenLayers. They are the
|
4
|
core functionality for the software: Everything that ends up on the map comes
|
5
|
from a layer. The base layer class is designed to be subclassed by any number
|
6
|
of different layers.
|
7
|
|
8
|
* Constructor
|
9
|
OpenLayers.Layer(name, options) -- All layers have a name as their first param. This name is used to display the layer in the LayerSwitcher, and for other purposes. The options parameter is used to replace any parameters of the Layer which need to be different.
|
10
|
|
11
|
* Methods
|
12
|
clone() -- {OpenLayers.Layer} -- create a clone of the layer.
|
13
|
setName({String|name}) -- none -- Set the name of the layer to something different.
|
14
|
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location.
|
15
|
reproject() -- none -- Subclassed by vector layers to redraw vectors when base layer changes.
|
16
|
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map.
|
17
|
getVisibility() -- {Boolean} -- Return true or false based on visibility of the layer.
|
18
|
setVisibility({Boolean|visible}) -- none -- Set the layer visibility, and trigger the appropriate events.
|
19
|
getResolution() -- {float} -- Return the current resolution of the map, in units/pixel.
|
20
|
getExtent() -- {OpenLayers.Bounds} -- Return the geographic extent of the current map viewport.
|
21
|
getZoomForExtent({OpenLayers.Bounds|bounds}) -- {Integer} -- return the integer zoom which most closely matches the passed bounds.
|
22
|
getLonLatFromViewPortPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns an OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the laye
|
23
|
getViewPortPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels
|
24
|
|
25
|
* Parameters
|
26
|
isBaseLayer -- This determines whether the layer is a base layer or an overlay. Only one Base Layer can be displayed on the map at once. Default is false.
|
27
|
projection -- SRS string to describe the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
28
|
maxExtent -- an OpenLayers.Bounds for the layer. This is the maximum geographic extent of the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
29
|
maxResolution -- The number of degrees per pixel at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
30
|
maxZoomLevel -- The maximum zoom level for the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
31
|
minScale -- The scale at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
32
|
maxScale -- The scale at the highest zoom level. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
33
|
units -- The units the map is projected into. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
|