new layerswitcher, improved google layer, boxes layer, grid fix
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1096 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+25
-20
@@ -22,7 +22,14 @@ OpenLayers.Layer.prototype = {
|
||||
* @type OpenLayers.Map */
|
||||
map: null,
|
||||
|
||||
|
||||
/** Whether or not the layer is a base layer. This should be set
|
||||
* individually by all subclasses.
|
||||
* Default is false
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
// OPTIONS
|
||||
|
||||
/** @type Array */
|
||||
@@ -135,6 +142,12 @@ OpenLayers.Layer.prototype = {
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
//this function can be implemented by subclasses.
|
||||
},
|
||||
|
||||
/**
|
||||
*/
|
||||
reproject:function() {
|
||||
//this function can be implemented by subclasses.
|
||||
},
|
||||
|
||||
/** Set the map property for the layer. This is done through an accessor
|
||||
* so that subclasses can override this and take special action once
|
||||
@@ -146,16 +159,6 @@ OpenLayers.Layer.prototype = {
|
||||
this.map = map;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Whether or not the layer is a base layer. This should be
|
||||
* determined individually by all subclasses. Default is false
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: function() {
|
||||
//this function should be implemented by all subclasses.
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Whether or not the layer is visible
|
||||
* @type Boolean
|
||||
@@ -165,18 +168,20 @@ OpenLayers.Layer.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {bool} visible
|
||||
*/
|
||||
setVisibility: function(visible) {
|
||||
* @param {Boolean} visible
|
||||
* @param {Boolean} noEvent
|
||||
*/
|
||||
setVisibility: function(visible, noEvent) {
|
||||
if (visible != this.getVisibility()) {
|
||||
this.div.style.display = (visible) ? "block" : "none";
|
||||
if (this.map != null) {
|
||||
if (visible) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
this.moveTo(this.map.getExtent());
|
||||
}
|
||||
if ((visible) && (this.map != null)) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
this.moveTo(this.map.getExtent());
|
||||
}
|
||||
}
|
||||
if ((this.map != null) &&
|
||||
((noEvent == null) || (noEvent == false))) {
|
||||
this.map.events.triggerEvent("changelayer");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user