[fusion-commits] r2841 - in trunk/lib/OpenLayers: . ext/OpenLayers/Layer
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Sat Jun 14 06:04:09 PDT 2014
Author: jng
Date: 2014-06-14 06:04:09 -0700 (Sat, 14 Jun 2014)
New Revision: 2841
Modified:
trunk/lib/OpenLayers/OpenLayers.js
trunk/lib/OpenLayers/ext/OpenLayers/Layer/MapGuide.js
Log:
#614: Fix defect where only the top-left tile is shown. Our OpenLayers.Layer.MapGuide has a bad and/or obsolete implementation of calculateGridLayout(). Compare this with the implementation in OL 2.13 proper, that one has no such method. Since tiles are working fine on un-modified OL 2.13 (proven with the tiled map example bundled with MapGuide that uses OL 2.13), we can only presume this method is no longer needed.
Modified: trunk/lib/OpenLayers/OpenLayers.js
===================================================================
--- trunk/lib/OpenLayers/OpenLayers.js 2014-06-14 01:13:20 UTC (rev 2840)
+++ trunk/lib/OpenLayers/OpenLayers.js 2014-06-14 13:04:09 UTC (rev 2841)
@@ -2618,7 +2618,7 @@
OpenLayers/Util.js
====================================================================== */
-/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
@@ -2691,7 +2691,7 @@
* {Boolean} true if the object is an array.
*/
OpenLayers.Util.isArray = function(a) {
- return (Object.prototype.toString.call(a) === '[object Array]');
+ return (Object.prototype.toString.call(a) === '[object Array]');
};
/**
@@ -2725,7 +2725,7 @@
* obj - {*}
*
* Returns:
- * {Integer} The index at which the first object was found in the array.
+ * {Integer} The index at, which the first object was found in the array.
* If not found, returns -1.
*/
OpenLayers.Util.indexOf = function(array, obj) {
@@ -2743,17 +2743,6 @@
};
-/**
- * Property: dotless
- * {RegExp}
- * Compiled regular expression to match dots ("."). This is used for replacing
- * dots in identifiers. Because object identifiers are frequently used for
- * DOM element identifiers by the library, we avoid using dots to make for
- * more sensible CSS selectors.
- *
- * TODO: Use a module pattern to avoid bloating the API with stuff like this.
- */
-OpenLayers.Util.dotless = /\./g;
/**
* Function: modifyDOMElement
@@ -2763,8 +2752,7 @@
*
* Parameters:
* element - {DOMElement} DOM element to modify.
- * id - {String} The element id attribute to set. Note that dots (".") will be
- * replaced with underscore ("_") in setting the element id.
+ * id - {String} The element id attribute to set.
* px - {<OpenLayers.Pixel>|Object} The element left and top position,
* OpenLayers.Pixel or an object with
* a 'x' and 'y' properties.
@@ -2782,7 +2770,7 @@
border, overflow, opacity) {
if (id) {
- element.id = id.replace(OpenLayers.Util.dotless, "_");
+ element.id = id;
}
if (px) {
element.style.left = px.x + "px";
@@ -2820,8 +2808,7 @@
* Parameters:
* id - {String} An identifier for this element. If no id is
* passed an identifier will be created
- * automatically. Note that dots (".") will be replaced with
- * underscore ("_") when generating ids.
+ * automatically.
* px - {<OpenLayers.Pixel>|Object} The element left and top position,
* OpenLayers.Pixel or an object with
* a 'x' and 'y' properties.
@@ -3486,17 +3473,11 @@
* url - {String} Optional url used to extract the query string.
* If url is null or is not supplied, query string is taken
* from the page location.
- * options - {Object} Additional options. Optional.
- *
- * Valid options:
- * splitArgs - {Boolean} Split comma delimited params into arrays? Default is
- * true.
*
* Returns:
* {Object} An object of key/value pairs from the query string.
*/
-OpenLayers.Util.getParameters = function(url, options) {
- options = options || {};
+OpenLayers.Util.getParameters = function(url) {
// if no url specified, take it from the location bar
url = (url === null || url === undefined) ? window.location.href : url;
@@ -3532,9 +3513,7 @@
}
// follow OGC convention of comma delimited values
- if (options.splitArgs !== false) {
- value = value.split(",");
- }
+ value = value.split(",");
//if there's only one value, do not return as array
if (value.length == 1) {
@@ -3562,7 +3541,6 @@
*
* Parameters:
* prefix - {String} Optional string to prefix unique id. Default is "id_".
- * Note that dots (".") in the prefix will be replaced with underscore ("_").
*
* Returns:
* {String} A unique id string, built on the passed in prefix.
@@ -3570,8 +3548,6 @@
OpenLayers.Util.createUniqueID = function(prefix) {
if (prefix == null) {
prefix = "id_";
- } else {
- prefix = prefix.replace(OpenLayers.Util.dotless, "_");
}
OpenLayers.Util.lastSeqID += 1;
return prefix + OpenLayers.Util.lastSeqID;
@@ -3590,8 +3566,8 @@
'inches': 1.0,
'ft': 12.0,
'mi': 63360.0,
- 'm': 39.37,
- 'km': 39370,
+ 'm': 39.3701,
+ 'km': 39370.1,
'dd': 4374754,
'yd': 36
};
@@ -3672,8 +3648,8 @@
"ch": OpenLayers.INCHES_PER_UNIT["IntnlChain"], //International Chain
"link": OpenLayers.INCHES_PER_UNIT["IntnlLink"], //International Link
"us-in": OpenLayers.INCHES_PER_UNIT["inches"], //U.S. Surveyor's Inch
- "us-ft": OpenLayers.INCHES_PER_UNIT["Foot"], //U.S. Surveyor's Foot
- "us-yd": OpenLayers.INCHES_PER_UNIT["Yard"], //U.S. Surveyor's Yard
+ "us-ft": OpenLayers.INCHES_PER_UNIT["Foot"], //U.S. Surveyor's Foot
+ "us-yd": OpenLayers.INCHES_PER_UNIT["Yard"], //U.S. Surveyor's Yard
"us-ch": OpenLayers.INCHES_PER_UNIT["GunterChain"], //U.S. Surveyor's Chain
"us-mi": OpenLayers.INCHES_PER_UNIT["Mile"], //U.S. Surveyor's Statute Mile
"ind-yd": OpenLayers.INCHES_PER_UNIT["IndianYd37"], //Indian Yard
@@ -3823,9 +3799,9 @@
if (forElement.getBoundingClientRect) { // IE
box = forElement.getBoundingClientRect();
- var scrollTop = window.pageYOffset || viewportElement.scrollTop;
- var scrollLeft = window.pageXOffset || viewportElement.scrollLeft;
-
+ var scrollTop = viewportElement.scrollTop;
+ var scrollLeft = viewportElement.scrollLeft;
+
pos[0] = box.left + scrollLeft;
pos[1] = box.top + scrollTop;
@@ -3927,8 +3903,7 @@
OpenLayers.Util.applyDefaults(options, {
ignoreCase: true,
ignorePort80: true,
- ignoreHash: true,
- splitArgs: false
+ ignoreHash: true
});
var urlObj1 = OpenLayers.Util.createUrlObject(url1, options);
@@ -3969,8 +3944,6 @@
* ignoreCase - {Boolean} lowercase url,
* ignorePort80 - {Boolean} don't include explicit port if port is 80,
* ignoreHash - {Boolean} Don't include part of url after the hash (#).
- * splitArgs - {Boolean} Split comma delimited params into arrays? Default is
- * true.
*
* Returns:
* {Object} An object with separate url, a, port, host, and args parsed out
@@ -4026,8 +3999,7 @@
var qMark = url.indexOf("?");
queryString = (qMark != -1) ? url.substr(qMark) : "";
}
- urlObject.args = OpenLayers.Util.getParameters(queryString,
- {splitArgs: options.splitArgs});
+ urlObject.args = OpenLayers.Util.getParameters(queryString);
// pathname
//
@@ -4166,7 +4138,7 @@
container.style.visibility = "hidden";
var containerElement = (options && options.containerElement)
- ? options.containerElement : document.body;
+ ? options.containerElement : document.body;
// Opera and IE7 can't handle a node with position:aboslute if it inherits
// position:absolute from a parent.
@@ -4342,9 +4314,9 @@
if (!dmsOption) {
dmsOption = 'dms'; //default to show degree, minutes, seconds
}
-
- coordinate = (coordinate+540)%360 - 180; // normalize for sphere being round
-
+
+ coordinate = (coordinate+540)%360 - 180; // normalize for sphere being round
+
var abscoordinate = Math.abs(coordinate);
var coordinatedegrees = Math.floor(abscoordinate);
@@ -42583,7 +42555,7 @@
tileColGroup += '0';
} else {
tileColGroup += Math.floor(Math.abs(newParams.tilecol/this.params.tileColumnsPerFolder)) * this.params.tileColumnsPerFolder;
- }
+ }
var tilePath = '/S' + Math.floor(newParams.scaleindex)
+ '/' + this.params.basemaplayergroupname
@@ -42601,42 +42573,6 @@
return requestString;
},
- /**
- * Method: calculateGridLayout
- * Generate parameters for the grid layout. This
- *
- * Parameters:
- * bounds - {<OpenLayers.Bound>}
- * origin - {<OpenLayers.LonLat>}
- * resolution - {Number}
- *
- * Returns:
- * {Object} Object containing properties tilelon, tilelat, tileoffsetlat,
- * tileoffsetlat, tileoffsetx, tileoffsety
- */
- calculateGridLayout: function(bounds, origin, resolution) {
- var tilelon = resolution * this.tileSize.w;
- var tilelat = resolution * this.tileSize.h;
-
- var offsetlon = bounds.left - origin.lon;
- var tilecol = Math.floor(offsetlon/tilelon) - this.buffer;
- var tilecolremain = offsetlon/tilelon - tilecol;
- var tileoffsetx = -tilecolremain * this.tileSize.w;
- var tileoffsetlon = origin.lon + tilecol * tilelon;
-
- var offsetlat = origin.lat - bounds.top + tilelat;
- var tilerow = Math.floor(offsetlat/tilelat) - this.buffer;
- var tilerowremain = tilerow - offsetlat/tilelat;
- var tileoffsety = tilerowremain * this.tileSize.h;
- var tileoffsetlat = origin.lat - tilelat*tilerow;
-
- return {
- tilelon: tilelon, tilelat: tilelat,
- tileoffsetlon: tileoffsetlon, tileoffsetlat: tileoffsetlat,
- tileoffsetx: tileoffsetx, tileoffsety: tileoffsety
- };
- },
-
CLASS_NAME: "OpenLayers.Layer.MapGuide"
});
/* ======================================================================
Modified: trunk/lib/OpenLayers/ext/OpenLayers/Layer/MapGuide.js
===================================================================
--- trunk/lib/OpenLayers/ext/OpenLayers/Layer/MapGuide.js 2014-06-14 01:13:20 UTC (rev 2840)
+++ trunk/lib/OpenLayers/ext/OpenLayers/Layer/MapGuide.js 2014-06-14 13:04:09 UTC (rev 2841)
@@ -421,7 +421,7 @@
tileColGroup += '0';
} else {
tileColGroup += Math.floor(Math.abs(newParams.tilecol/this.params.tileColumnsPerFolder)) * this.params.tileColumnsPerFolder;
- }
+ }
var tilePath = '/S' + Math.floor(newParams.scaleindex)
+ '/' + this.params.basemaplayergroupname
@@ -439,41 +439,5 @@
return requestString;
},
- /**
- * Method: calculateGridLayout
- * Generate parameters for the grid layout. This
- *
- * Parameters:
- * bounds - {<OpenLayers.Bound>}
- * origin - {<OpenLayers.LonLat>}
- * resolution - {Number}
- *
- * Returns:
- * {Object} Object containing properties tilelon, tilelat, tileoffsetlat,
- * tileoffsetlat, tileoffsetx, tileoffsety
- */
- calculateGridLayout: function(bounds, origin, resolution) {
- var tilelon = resolution * this.tileSize.w;
- var tilelat = resolution * this.tileSize.h;
-
- var offsetlon = bounds.left - origin.lon;
- var tilecol = Math.floor(offsetlon/tilelon) - this.buffer;
- var tilecolremain = offsetlon/tilelon - tilecol;
- var tileoffsetx = -tilecolremain * this.tileSize.w;
- var tileoffsetlon = origin.lon + tilecol * tilelon;
-
- var offsetlat = origin.lat - bounds.top + tilelat;
- var tilerow = Math.floor(offsetlat/tilelat) - this.buffer;
- var tilerowremain = tilerow - offsetlat/tilelat;
- var tileoffsety = tilerowremain * this.tileSize.h;
- var tileoffsetlat = origin.lat - tilelat*tilerow;
-
- return {
- tilelon: tilelon, tilelat: tilelat,
- tileoffsetlon: tileoffsetlon, tileoffsetlat: tileoffsetlat,
- tileoffsetx: tileoffsetx, tileoffsety: tileoffsety
- };
- },
-
CLASS_NAME: "OpenLayers.Layer.MapGuide"
});
More information about the fusion-commits
mailing list