Merge branch 'master' of github.com:openlayers/openlayers

This commit is contained in:
ahocevar
2012-03-04 11:25:10 +01:00
36 changed files with 350 additions and 400 deletions
+4 -12
View File
@@ -258,9 +258,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
activate: function () {
if (!this.active) {
for(var i in this.handlers) {
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].activate();
}
this.handlers[i].activate();
}
}
return OpenLayers.Control.prototype.activate.apply(
@@ -278,9 +276,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
deactivate: function () {
if (this.active) {
for(var i in this.handlers) {
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].deactivate();
}
this.handlers[i].deactivate();
}
}
return OpenLayers.Control.prototype.deactivate.apply(
@@ -564,9 +560,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
unselectAll: function() {
// we'll want an option to supress notification here
for(var fid in this.features) {
if (this.features.hasOwnProperty(fid)) {
this.unselect(this.features[fid]);
}
this.unselect(this.features[fid]);
}
},
@@ -579,9 +573,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
*/
setMap: function(map) {
for(var i in this.handlers) {
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].setMap(map);
}
this.handlers[i].setMap(map);
}
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},
+2 -2
View File
@@ -231,8 +231,8 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
* mouseposition. feature - {<OpenLayers.Feature.Vector>} The sketch feature.
*/
measureImmediate : function(point, feature, drawing) {
if (drawing && this.delayedTrigger === null &&
!this.handler.freehandMode(this.handler.evt)) {
if (drawing && !this.handler.freehandMode(this.handler.evt)) {
this.cancelDelay();
this.measure(feature.geometry, "measurepartial");
}
},
+23 -31
View File
@@ -193,9 +193,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
this.next.destroy();
this.deactivate();
for(var prop in this) {
if (this.hasOwnProperty(prop)) {
this[prop] = null;
}
this[prop] = null;
}
},
@@ -336,27 +334,25 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
setListeners: function() {
this.listeners = {};
for(var type in this.registry) {
if (this.registry.hasOwnProperty(type)) {
this.listeners[type] = OpenLayers.Function.bind(function() {
if(!this.restoring) {
var state = this.registry[type].apply(this, arguments);
this.previousStack.unshift(state);
if(this.previousStack.length > 1) {
this.onPreviousChange(
this.previousStack[1], this.previousStack.length - 1
);
}
if(this.previousStack.length > (this.limit + 1)) {
this.previousStack.pop();
}
if(this.nextStack.length > 0) {
this.nextStack = [];
this.onNextChange(null, 0);
}
this.listeners[type] = OpenLayers.Function.bind(function() {
if(!this.restoring) {
var state = this.registry[type].apply(this, arguments);
this.previousStack.unshift(state);
if(this.previousStack.length > 1) {
this.onPreviousChange(
this.previousStack[1], this.previousStack.length - 1
);
}
return true;
}, this);
}
if(this.previousStack.length > (this.limit + 1)) {
this.previousStack.pop();
}
if(this.nextStack.length > 0) {
this.nextStack = [];
this.onNextChange(null, 0);
}
}
return true;
}, this);
}
},
@@ -375,9 +371,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
this.setListeners();
}
for(var type in this.listeners) {
if (this.listeners.hasOwnProperty(type)) {
this.map.events.register(type, this, this.listeners[type]);
}
this.map.events.register(type, this, this.listeners[type]);
}
activated = true;
if(this.previousStack.length == 0) {
@@ -411,11 +405,9 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
if(this.map) {
if(OpenLayers.Control.prototype.deactivate.apply(this)) {
for(var type in this.listeners) {
if (this.listeners.hasOwnProperty(type)) {
this.map.events.unregister(
type, this, this.listeners[type]
);
}
this.map.events.unregister(
type, this, this.listeners[type]
);
}
if(this.clearOnDeactivate) {
this.clear();
+5 -4
View File
@@ -94,12 +94,13 @@ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, {
* APIMethod: destroy
*/
destroy: function() {
if (this.element.parentNode == this.div) {
if (this.element && this.element.parentNode == this.div) {
this.div.removeChild(this.element);
this.element = null;
}
if (this.map) {
this.map.events.unregister('moveend', this, this.updateLink);
}
this.element = null;
this.map.events.unregister('moveend', this, this.updateLink);
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
+4 -9
View File
@@ -168,16 +168,11 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
* Take care of things that are not handled in superclass.
*/
destroy: function() {
var key;
for (key in this.layerCache) {
if (this.layerCache.hasOwnProperty(key)) {
delete this.layerCache[key];
}
for (var key in this.layerCache) {
delete this.layerCache[key];
}
for (key in this.wfsCache) {
if (this.wfsCache.hasOwnProperty(key)) {
delete this.wfsCache[key];
}
for (var key in this.wfsCache) {
delete this.wfsCache[key];
}
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
+4 -6
View File
@@ -456,12 +456,10 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
}
var layers;
for (var url in services) {
if (services.hasOwnProperty(url)) {
layers = services[url];
var wmsOptions = this.buildWMSOptions(url, layers,
clickPosition, layers[0].params.FORMAT);
OpenLayers.Request.GET(wmsOptions);
}
layers = services[url];
var wmsOptions = this.buildWMSOptions(url, layers,
clickPosition, layers[0].params.FORMAT);
OpenLayers.Request.GET(wmsOptions);
}
}
},