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:
@@ -109,6 +109,7 @@
|
||||
"OpenLayers/Layer/Boxes.js",
|
||||
"OpenLayers/Layer/TMS.js",
|
||||
"OpenLayers/Layer/TileCache.js",
|
||||
"OpenLayers/Layer/DigitalGlobe.js",
|
||||
"OpenLayers/Popup/Anchored.js",
|
||||
"OpenLayers/Popup/AnchoredBubble.js",
|
||||
"OpenLayers/Feature.js",
|
||||
@@ -196,7 +197,9 @@
|
||||
h.appendChild(s);
|
||||
}
|
||||
}
|
||||
if (allScriptTags) document.write(allScriptTags);
|
||||
if (allScriptTags) {
|
||||
document.write(allScriptTags);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@@ -135,9 +135,9 @@ OpenLayers.Ajax = {
|
||||
*/
|
||||
getTransport: function() {
|
||||
return OpenLayers.Util.Try(
|
||||
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
||||
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
|
||||
function() {return new XMLHttpRequest()}
|
||||
function() {return new ActiveXObject('Msxml2.XMLHTTP');},
|
||||
function() {return new ActiveXObject('Microsoft.XMLHTTP');},
|
||||
function() {return new XMLHttpRequest();}
|
||||
) || false;
|
||||
},
|
||||
|
||||
@@ -167,9 +167,11 @@ OpenLayers.Ajax.Responders = {
|
||||
* responderToAdd - {?}
|
||||
*/
|
||||
register: function(responderToAdd) {
|
||||
for (var i = 0; i < this.responders.length; i++)
|
||||
if (responderToAdd == this.responders[i])
|
||||
for (var i = 0; i < this.responders.length; i++){
|
||||
if (responderToAdd == this.responders[i]){
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.responders.push(responderToAdd);
|
||||
},
|
||||
|
||||
@@ -289,8 +291,9 @@ OpenLayers.Ajax.Request = OpenLayers.Class(OpenLayers.Ajax.Base, {
|
||||
*/
|
||||
request: function(url) {
|
||||
var parameters = this.options.parameters || '';
|
||||
if (parameters.length > 0) parameters += '&_=';
|
||||
|
||||
if (parameters.length > 0) {
|
||||
parameters += '&_=';
|
||||
}
|
||||
try {
|
||||
this.url = url;
|
||||
if (this.options.method == 'get' && parameters.length > 0) {
|
||||
@@ -307,7 +310,7 @@ OpenLayers.Ajax.Request = OpenLayers.Class(OpenLayers.Ajax.Base, {
|
||||
|
||||
if (this.options.asynchronous) {
|
||||
setTimeout(OpenLayers.Function.bind(
|
||||
(function() {this.respondToReadyState(1)}),this), 10
|
||||
(function() {this.respondToReadyState(1);}),this), 10
|
||||
);
|
||||
}
|
||||
|
||||
@@ -525,4 +528,4 @@ OpenLayers.Ajax.serializeXMLToString = function(xmldom) {
|
||||
var serializer = new XMLSerializer();
|
||||
data = serializer.serializeToString(xmldom);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ OpenLayers.Class = function() {
|
||||
if (arguments && arguments[0] != OpenLayers.Class.isPrototype) {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
var extended = {};
|
||||
var parent;
|
||||
for(var i=0; i<arguments.length; ++i) {
|
||||
@@ -46,7 +46,7 @@ OpenLayers.Class = function() {
|
||||
}
|
||||
Class.prototype = extended;
|
||||
return Class;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Property: isPrototype
|
||||
@@ -64,10 +64,11 @@ OpenLayers.Class.isPrototype = function () {};
|
||||
*/
|
||||
OpenLayers.Class.create = function() {
|
||||
return function() {
|
||||
if (arguments && arguments[0] != OpenLayers.Class.isPrototype)
|
||||
if (arguments && arguments[0] != OpenLayers.Class.isPrototype) {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -92,4 +93,4 @@ OpenLayers.Class.inherit = function () {
|
||||
OpenLayers.Util.extend(proto, arguments[i]);
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -145,8 +145,9 @@ OpenLayers.Event = {
|
||||
findElement: function(event, tagName) {
|
||||
var element = OpenLayers.Event.element(event);
|
||||
while (element.parentNode && (!element.tagName ||
|
||||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
|
||||
(element.tagName.toUpperCase() != tagName.toUpperCase()))){
|
||||
element = element.parentNode;
|
||||
}
|
||||
return element;
|
||||
},
|
||||
|
||||
@@ -637,7 +638,7 @@ OpenLayers.Events = OpenLayers.Class({
|
||||
*/
|
||||
handleBrowserEvent: function (evt) {
|
||||
evt.xy = this.getMousePosition(evt);
|
||||
this.triggerEvent(evt.type, evt)
|
||||
this.triggerEvent(evt.type, evt);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ OpenLayers.State = {
|
||||
INSERT: 'Insert',
|
||||
UPDATE: 'Update',
|
||||
DELETE: 'Delete'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Feature.js
|
||||
|
||||
@@ -27,7 +27,7 @@ OpenLayers.Feature.WFS = OpenLayers.Class(OpenLayers.Feature, {
|
||||
initialize: function(layer, xmlNode) {
|
||||
var newArguments = arguments;
|
||||
var data = this.processXMLNode(xmlNode);
|
||||
newArguments = new Array(layer, data.lonlat, data)
|
||||
newArguments = new Array(layer, data.lonlat, data);
|
||||
OpenLayers.Feature.prototype.initialize.apply(this, newArguments);
|
||||
this.createMarker();
|
||||
this.layer.addMarker(this.marker);
|
||||
|
||||
@@ -174,7 +174,7 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
|
||||
case "FeatureCollection":
|
||||
// allow for any type to be converted to a feature collection
|
||||
valid = true;
|
||||
break
|
||||
break;
|
||||
default:
|
||||
// for GeometryCollection and Feature, types must match
|
||||
if(obj.type == type) {
|
||||
@@ -489,7 +489,7 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
|
||||
*/
|
||||
createCRSObject: function(object) {
|
||||
var proj = object.layer.projection;
|
||||
var crs = {}
|
||||
var crs = {};
|
||||
if (proj.match(/epsg:/i)) {
|
||||
var code = parseInt(proj.substring(proj.indexOf(":") + 1));
|
||||
if (code == 4326) {
|
||||
@@ -534,7 +534,7 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
|
||||
"id": feature.fid == null ? feature.id : feature.fid,
|
||||
"properties": feature.attributes,
|
||||
"geometry": geom
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -553,7 +553,7 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
|
||||
return {
|
||||
"type": geometryType,
|
||||
"coordinates": data
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -281,7 +281,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
for(var i=0; i<rings.length; ++i) {
|
||||
ring = rings[i].replace(this.regExes.trimParens, '$1');
|
||||
linestring = this.parse.linestring.apply(this, [ring]).geometry;
|
||||
linearring = new OpenLayers.Geometry.LinearRing(linestring.components)
|
||||
linearring = new OpenLayers.Geometry.LinearRing(linestring.components);
|
||||
components.push(linearring);
|
||||
}
|
||||
return new OpenLayers.Feature.Vector(
|
||||
|
||||
@@ -86,4 +86,4 @@ OpenLayers.Geometry.Polygon.createRegularPolygon = function(origin, radius, side
|
||||
}
|
||||
var ring = new OpenLayers.Geometry.LinearRing(points);
|
||||
return new OpenLayers.Geometry.Polygon([ring]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,7 +157,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
|
||||
if(!this.oldOnselectstart) {
|
||||
this.oldOnselectstart = document.onselectstart;
|
||||
document.onselectstart = function() {return false;}
|
||||
document.onselectstart = function() {return false;};
|
||||
}
|
||||
|
||||
propagate = false;
|
||||
@@ -187,7 +187,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
this.callback("move", [evt.xy]);
|
||||
if(!this.oldOnselectstart) {
|
||||
this.oldOnselectstart = document.onselectstart;
|
||||
document.onselectstart = function() {return false;}
|
||||
document.onselectstart = function() {return false;};
|
||||
}
|
||||
this.last = evt.xy;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
if(document.onselectstart) {
|
||||
document.onselectstart = this.oldOnselectstart;
|
||||
}
|
||||
this.callback("done", [evt.xy])
|
||||
this.callback("done", [evt.xy]);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -65,8 +65,9 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
|
||||
*/
|
||||
onWheelEvent: function(e){
|
||||
// first check keyboard modifiers
|
||||
if (!this.checkModifiers(e)) return;
|
||||
|
||||
if (!this.checkModifiers(e)) {
|
||||
return;
|
||||
}
|
||||
// first determine whether or not the wheeling was inside the map
|
||||
var inMap = false;
|
||||
var elem = OpenLayers.Event.element(e);
|
||||
|
||||
@@ -666,7 +666,7 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
// now we have numZoomLevels and maxResolution,
|
||||
// we can populate the resolutions array
|
||||
for (var i=0; i < confProps.numZoomLevels; i++) {
|
||||
var res = confProps.maxResolution / Math.pow(2, i)
|
||||
var res = confProps.maxResolution / Math.pow(2, i);
|
||||
confProps.resolutions.push(res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
|
||||
if ( (this.mapObject != null) &&
|
||||
(this.getMapObjectCenter() != null) ) {
|
||||
var moPixel = this.getMapObjectPixelFromOLPixel(viewPortPx);
|
||||
var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel)
|
||||
var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel);
|
||||
lonlat = this.getOLLonLatFromMapObjectLonLat(moLonLat);
|
||||
}
|
||||
return lonlat;
|
||||
@@ -281,7 +281,7 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
|
||||
(this.getMapObjectCenter() != null) ) {
|
||||
|
||||
var moLonLat = this.getMapObjectLonLatFromOLLonLat(lonlat);
|
||||
var moPixel = this.getMapObjectPixelFromMapObjectLonLat(moLonLat)
|
||||
var moPixel = this.getMapObjectPixelFromMapObjectLonLat(moLonLat);
|
||||
|
||||
viewPortPx = this.getOLPixelFromMapObjectPixel(moPixel);
|
||||
}
|
||||
|
||||
@@ -195,9 +195,13 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
|
||||
if ((title != null) && (description != null)) {
|
||||
contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';
|
||||
contentHTML += '<div class="olLayerGeoRSSTitle">';
|
||||
if (link) contentHTML += '<a class="link" href="'+link+'" target="_blank">';
|
||||
if (link) {
|
||||
contentHTML += '<a class="link" href="'+link+'" target="_blank">';
|
||||
}
|
||||
contentHTML += title;
|
||||
if (link) contentHTML += '</a>';
|
||||
if (link) {
|
||||
contentHTML += '</a>';
|
||||
}
|
||||
contentHTML += '</div>';
|
||||
contentHTML += '<div style="" class="olLayerGeoRSSDescription">';
|
||||
contentHTML += description;
|
||||
|
||||
@@ -296,7 +296,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
var html = "";
|
||||
html += "The Google Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, select a new BaseLayer "
|
||||
html += "To get rid of this message, select a new BaseLayer ";
|
||||
html += "in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the Google Maps library";
|
||||
@@ -304,7 +304,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
html += " correct API key for your site.<br>";
|
||||
html += "<br>";
|
||||
html += "Developers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/Google' "
|
||||
html += "<a href='http://trac.openlayers.org/wiki/Google' ";
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
@@ -99,14 +99,14 @@ OpenLayers.Layer.MultiMap = OpenLayers.Class(
|
||||
var html = "";
|
||||
html += "The MM Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, select a new BaseLayer "
|
||||
html += "To get rid of this message, select a new BaseLayer ";
|
||||
html += "in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the MM library";
|
||||
html += " script was either not correctly included.<br>";
|
||||
html += "<br>";
|
||||
html += "Demmlopers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/MultiMap' "
|
||||
html += "<a href='http://trac.openlayers.org/wiki/MultiMap' ";
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
@@ -106,12 +106,12 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
|
||||
} else if (columns[valIndex] == 'lon') {
|
||||
location.lon = parseFloat(vals[valIndex]);
|
||||
set = true;
|
||||
} else if (columns[valIndex] == 'title')
|
||||
} else if (columns[valIndex] == 'title') {
|
||||
title = vals[valIndex];
|
||||
else if (columns[valIndex] == 'image' ||
|
||||
columns[valIndex] == 'icon')
|
||||
} else if (columns[valIndex] == 'image' ||
|
||||
columns[valIndex] == 'icon') {
|
||||
url = vals[valIndex];
|
||||
else if (columns[valIndex] == 'iconSize') {
|
||||
} else if (columns[valIndex] == 'iconSize') {
|
||||
var size = vals[valIndex].split(',');
|
||||
iconSize = new OpenLayers.Size(parseFloat(size[0]),
|
||||
parseFloat(size[1]));
|
||||
|
||||
@@ -121,14 +121,14 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
|
||||
var html = "";
|
||||
html += "The VE Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, select a new BaseLayer "
|
||||
html += "To get rid of this message, select a new BaseLayer ";
|
||||
html += "in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the VE library";
|
||||
html += " script was either not correctly included.<br>";
|
||||
html += "<br>";
|
||||
html += "Developers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/VirtualEarth' "
|
||||
html += "<a href='http://trac.openlayers.org/wiki/VirtualEarth' ";
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
@@ -154,10 +154,12 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
bounds = this.adjustBounds(bounds);
|
||||
|
||||
var imageSize = this.getImageSize();
|
||||
return this.getFullRequestString(
|
||||
var s = this.getFullRequestString(
|
||||
{BBOX: this.encodeBBOX ? bounds.toBBOX() : bounds.toArray(),
|
||||
WIDTH:imageSize.w,
|
||||
HEIGHT:imageSize.h});
|
||||
//console.log(s);
|
||||
return s;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,9 +130,9 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
|
||||
fixYahooEventPane: function() {
|
||||
var yahooEventPane = OpenLayers.Util.getElement("ygddfdiv");
|
||||
if (yahooEventPane != null) {
|
||||
if (yahooEventPane.parentNode != null)
|
||||
if (yahooEventPane.parentNode != null) {
|
||||
yahooEventPane.parentNode.removeChild(yahooEventPane);
|
||||
|
||||
}
|
||||
this.map.events.unregister("moveend", this,
|
||||
this.fixYahooEventPane);
|
||||
}
|
||||
@@ -150,14 +150,14 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
|
||||
var html = "";
|
||||
html += "The Yahoo Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, select a new BaseLayer "
|
||||
html += "To get rid of this message, select a new BaseLayer ";
|
||||
html += "in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the Yahoo library";
|
||||
html += " script was either not correctly included.<br>";
|
||||
html += "<br>";
|
||||
html += "Developers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/Yahoo' "
|
||||
html += "<a href='http://trac.openlayers.org/wiki/Yahoo' ";
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
@@ -905,8 +905,9 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this.events.element.offsets = null;
|
||||
var newSize = this.getCurrentSize();
|
||||
var oldSize = this.getSize();
|
||||
if (oldSize == null)
|
||||
if (oldSize == null) {
|
||||
this.size = oldSize = newSize;
|
||||
}
|
||||
if (!newSize.equals(oldSize)) {
|
||||
|
||||
// store the new size
|
||||
|
||||
@@ -169,7 +169,7 @@ OpenLayers.Popup = OpenLayers.Class({
|
||||
var closePopup = closeBoxCallback || function(e) {
|
||||
this.hide();
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
};
|
||||
OpenLayers.Event.observe(closeImg, "click",
|
||||
OpenLayers.Function.bindAsEventListener(closePopup, this));
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
var linearRing = geometry.components[j];
|
||||
d += " M";
|
||||
for (var i = 0; i < linearRing.components.length; i++) {
|
||||
var component = this.getShortString(linearRing.components[i])
|
||||
var component = this.getShortString(linearRing.components[i]);
|
||||
if (component) {
|
||||
d += " " + component;
|
||||
} else {
|
||||
|
||||
@@ -524,9 +524,9 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
var y = geometry.components[i].y / resolution;
|
||||
|
||||
if ((i%3)==0 && (i/3)==0) {
|
||||
path += "m"
|
||||
path += "m";
|
||||
} else if ((i%3)==1) {
|
||||
path += " c"
|
||||
path += " c";
|
||||
}
|
||||
path += " " + x + "," + y;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
this.isLoading = false;
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
}
|
||||
};
|
||||
OpenLayers.Event.observe(this.imgDiv, 'load',
|
||||
OpenLayers.Function.bind(onload, this));
|
||||
|
||||
|
||||
@@ -117,7 +117,9 @@ OpenLayers.Util.clearArray = function(array) {
|
||||
OpenLayers.Util.indexOf = function(array, obj) {
|
||||
|
||||
for(var i=0; i < array.length; i++) {
|
||||
if (array[i] == obj) return i;
|
||||
if (array[i] == obj) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
@@ -293,7 +295,7 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
OpenLayers.Util.setOpacity = function(element, opacity) {
|
||||
OpenLayers.Util.modifyDOMElement(element, null, null, null,
|
||||
null, null, null, opacity);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: onImageLoad
|
||||
@@ -373,7 +375,7 @@ OpenLayers.Util.alphaHack = function() {
|
||||
|
||||
return ( filter &&
|
||||
(version >= 5.5) && (version < 7) );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: modifyAlphaImageDiv
|
||||
@@ -587,7 +589,7 @@ OpenLayers.Util.Try = function() {
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -681,10 +683,12 @@ OpenLayers.Util.getXmlNodeValue = function(node) {
|
||||
OpenLayers.Util.Try(
|
||||
function() {
|
||||
val = node.text;
|
||||
if (!val)
|
||||
if (!val) {
|
||||
val = node.textContent;
|
||||
if (!val)
|
||||
}
|
||||
if (!val) {
|
||||
val = node.firstChild.nodeValue;
|
||||
}
|
||||
},
|
||||
function() {
|
||||
val = node.textContent;
|
||||
@@ -747,7 +751,9 @@ OpenLayers.Util.distVincenty=function(p1, p2) {
|
||||
var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda);
|
||||
var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) +
|
||||
(cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));
|
||||
if (sinSigma==0) return 0; // co-incident points
|
||||
if (sinSigma==0) {
|
||||
return 0; // co-incident points
|
||||
}
|
||||
var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;
|
||||
var sigma = Math.atan2(sinSigma, cosSigma);
|
||||
var alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma);
|
||||
@@ -758,7 +764,9 @@ OpenLayers.Util.distVincenty=function(p1, p2) {
|
||||
lambda = L + (1-C) * f * Math.sin(alpha) *
|
||||
(sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
|
||||
}
|
||||
if (iterLimit==0) return NaN // formula failed to converge
|
||||
if (iterLimit==0) {
|
||||
return NaN; // formula failed to converge
|
||||
}
|
||||
var uSq = cosSqAlpha * (a*a - b*b) / (b*b);
|
||||
var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
|
||||
var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
|
||||
@@ -783,9 +791,9 @@ OpenLayers.Util.distVincenty=function(p1, p2) {
|
||||
* {Object} An object of key/value pairs from the query string.
|
||||
*/
|
||||
OpenLayers.Util.getParameters = function(url) {
|
||||
//if no url specified, take it from the location bar
|
||||
url = url || window.location.href
|
||||
if(url == null) {
|
||||
/* if no url specified, take it from the location bar */
|
||||
url = url || window.location.href;
|
||||
if (url == null) {
|
||||
url = window.location.href;
|
||||
}
|
||||
|
||||
@@ -980,7 +988,7 @@ OpenLayers.Util.safeStopPropagation = function(evt) {
|
||||
* Parameters:
|
||||
* forElement - {DOMElement}
|
||||
*
|
||||
* Returns:<EFBFBD>
|
||||
* Returns:´
|
||||
* {Array} two item array, L value then T value.
|
||||
*/
|
||||
OpenLayers.Util.pagePosition = function(forElement) {
|
||||
@@ -1184,7 +1192,7 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
||||
var index = relStr.indexOf("../");
|
||||
|
||||
if (index == 0) {
|
||||
backs++
|
||||
backs++;
|
||||
relStr = relStr.substr(3);
|
||||
} else if (index >= 0) {
|
||||
var prevChunk = relStr.substr(0,index - 1);
|
||||
|
||||
@@ -79,5 +79,4 @@ function (fn, expectedException, doc) {
|
||||
} else {
|
||||
this.fail(doc);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user