large scale syntactic clean up adding missing semi-colons and curly braces around blocks.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5002 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -36,7 +36,7 @@ OpenLayers.Control.EditingToolbar = OpenLayers.Class(
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Polygon, {'displayClass': 'olControlDrawFeaturePolygon'})
|
||||
];
|
||||
for (var i = 0; i < controls.length; i++) {
|
||||
controls[i].featureAdded = function(feature) { feature.state = OpenLayers.State.INSERT; }
|
||||
controls[i].featureAdded = function(feature) { feature.state = OpenLayers.State.INSERT; };
|
||||
}
|
||||
this.addControls(controls);
|
||||
},
|
||||
|
||||
@@ -281,7 +281,7 @@ OpenLayers.Control.LayerSwitcher =
|
||||
'inputElem': inputElem,
|
||||
'layer': layer,
|
||||
'layerSwitcher': this
|
||||
}
|
||||
};
|
||||
OpenLayers.Event.observe(inputElem, "mouseup",
|
||||
OpenLayers.Function.bindAsEventListener(this.onInputClick,
|
||||
context)
|
||||
|
||||
@@ -104,7 +104,9 @@ OpenLayers.Control.MouseDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Boolean}
|
||||
*/
|
||||
defaultClick: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
var notAfterDrag = !this.performedDrag;
|
||||
this.performedDrag = false;
|
||||
return notAfterDrag;
|
||||
@@ -130,7 +132,9 @@ OpenLayers.Control.MouseDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.performedDrag = false;
|
||||
if (evt.shiftKey) {
|
||||
@@ -148,7 +152,7 @@ OpenLayers.Control.MouseDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
|
||||
this.map.viewPortDiv.appendChild(this.zoomBox);
|
||||
}
|
||||
document.onselectstart=function() { return false; }
|
||||
document.onselectstart=function() { return false; };
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
@@ -196,7 +200,9 @@ OpenLayers.Control.MouseDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
if (this.zoomBox) {
|
||||
this.zoomBoxEnd(evt);
|
||||
} else {
|
||||
|
||||
@@ -123,7 +123,9 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonDown: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
this.buttonClicked = evt.element.action;
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
@@ -135,7 +137,9 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonUp: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
if (this.buttonClicked != null) {
|
||||
if (this.buttonClicked == evt.element.action) {
|
||||
this.switchModeTo(evt.element.action);
|
||||
@@ -167,7 +171,9 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.performedDrag = false;
|
||||
this.startViaKeyboard = false;
|
||||
@@ -242,7 +248,7 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
this.map.div.style.cursor = "move";
|
||||
break;
|
||||
}
|
||||
document.onselectstart = function() { return false; }
|
||||
document.onselectstart = function() { return false; };
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
@@ -333,11 +339,15 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
switch (this.mode) {
|
||||
case "zoombox":
|
||||
this.zoomBoxEnd(evt);
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
if (this.startViaKeyboard) {
|
||||
this.leaveMode();
|
||||
}
|
||||
break;
|
||||
case "pan":
|
||||
if (this.performedDrag) {
|
||||
@@ -360,7 +370,9 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
if (this.zoomBox) {
|
||||
this.removeZoomBox();
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
if (this.startViaKeyboard) {
|
||||
this.leaveMode();
|
||||
}
|
||||
}
|
||||
this.mouseDragStart = null;
|
||||
this.map.div.style.cursor = "default";
|
||||
|
||||
@@ -108,8 +108,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
wheelChange: function(evt, deltaZ) {
|
||||
var newZoom = this.map.getZoom() + deltaZ;
|
||||
if (!this.map.isValidZoomLevel(newZoom)) return;
|
||||
|
||||
if (!this.map.isValidZoomLevel(newZoom)) {
|
||||
return;
|
||||
}
|
||||
var size = this.map.getSize();
|
||||
var deltaX = size.w/2 - evt.xy.x;
|
||||
var deltaY = evt.xy.y - size.h/2;
|
||||
|
||||
@@ -308,7 +308,9 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseDown: function (evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
this.rectDragStart = evt.xy.clone();
|
||||
this.performedRectDrag = false;
|
||||
OpenLayers.Event.stop(evt);
|
||||
@@ -355,7 +357,9 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseUp: function(evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
if(this.performedRectDrag) {
|
||||
this.updateMapToRect();
|
||||
OpenLayers.Event.stop(evt);
|
||||
|
||||
@@ -151,7 +151,9 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this.action) {
|
||||
case "panup":
|
||||
|
||||
@@ -72,7 +72,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
this.divEvents = null;
|
||||
|
||||
this.map.events.unregister("zoomend", this, this.moveZoomBar);
|
||||
this.map.events.unregister("changebaselayer", this, this.redraw)
|
||||
this.map.events.unregister("changebaselayer", this, this.redraw);
|
||||
|
||||
OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
@@ -155,7 +155,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
sz = new OpenLayers.Size();
|
||||
sz.h = this.zoomStopHeight * this.map.getNumZoomLevels();
|
||||
sz.w = this.zoomStopWidth;
|
||||
var div = null
|
||||
var div = null;
|
||||
|
||||
if (OpenLayers.Util.alphaHack()) {
|
||||
var id = "OpenLayers_Control_PanZoomBar" + this.map.id;
|
||||
@@ -211,7 +211,9 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
* and sets the zoom level appropriately.
|
||||
*/
|
||||
divClick: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
var y = evt.xy.y;
|
||||
var top = OpenLayers.Util.pagePosition(evt.object)[1];
|
||||
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
||||
@@ -227,7 +229,9 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
zoomBarDown:function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
this.map.events.register("mousemove", this, this.passEventToSlider);
|
||||
this.map.events.register("mouseup", this, this.passEventToSlider);
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
@@ -250,7 +254,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
*/
|
||||
zoomBarDrag:function(evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
var deltaY = this.mouseDragStart.y - evt.xy.y
|
||||
var deltaY = this.mouseDragStart.y - evt.xy.y;
|
||||
var offsets = OpenLayers.Util.pagePosition(this.zoombarDiv);
|
||||
if ((evt.clientY - offsets[1]) > 0 &&
|
||||
(evt.clientY - offsets[1]) < parseInt(this.zoombarDiv.style.height) - 2) {
|
||||
@@ -271,12 +275,14 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
zoomBarUp:function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) {
|
||||
return;
|
||||
}
|
||||
if (this.zoomStart) {
|
||||
this.div.style.cursor="";
|
||||
this.map.events.unregister("mouseup", this, this.passEventToSlider);
|
||||
this.map.events.unregister("mousemove", this, this.passEventToSlider);
|
||||
var deltaY = this.zoomStart.y - evt.xy.y
|
||||
var deltaY = this.zoomStart.y - evt.xy.y;
|
||||
this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight));
|
||||
this.moveZoomBar();
|
||||
this.mouseDragStart = null;
|
||||
|
||||
@@ -55,7 +55,9 @@ OpenLayers.Control.Scale = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
updateScale: function() {
|
||||
var scale = this.map.getScale();
|
||||
if (!scale) return;
|
||||
if (!scale) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (scale >= 9500 && scale <= 950000) {
|
||||
scale = Math.round(scale / 1000) + "K";
|
||||
|
||||
Reference in New Issue
Block a user