[mapguide-users] MapGuide Open Source 2.6 Beta 1 released

Bernhard Maehler bernhard.maehler at gmx.de
Fri Jun 20 09:46:19 PDT 2014


I noticed an issue with Fusion and HttpTiles using AIMS 2015.
It doesn't work anymore, I just get a blank map without any tiles.
The problem also occurs with MapGuide Open Source 2.6 Beta 1.
Meanwhile I found out that the cause of the problem are changes in
OpenLayers.js (MapGuide.js).
The problem doesn't occur, if I use the original OpenLayers.js (Version
2.13.1) from openlayers.org.
What are the differences?
In OpenLayers.js which comes with AIMS 2015 / MapGuide Open Source 2.6 Beta
1 the function calculateGridLayout
as part of OpenLayers/Layer/Grid.js is overwritten in section MapGuide.js. 

/* ======================================================================
    OpenLayers/Layer/Grid.js
   ====================================================================== */
   
   ....
    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 rowSign = this.rowSign;

        var offsetlat = rowSign * (origin.lat - bounds.top + tilelat);  
        var tilerow = Math[~rowSign ? 'floor' : 'ceil'](offsetlat/tilelat) -
this.buffer * rowSign;
        
        return { 
          tilelon: tilelon, tilelat: tilelat,
          startcol: tilecol, startrow: tilerow
        };
	...

/* ======================================================================
    OpenLayers/Layer/MapGuide.js
   ====================================================================== */	
	...
    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
        };
	...
	
If I remove above lines from section MapGuide.js (as in the original
OpenLayer.js) erverything works fine again!
As I am not a programmer, what are the reasons for the changes in
MapGuide.js?

Thanks,
Bernhard



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/MapGuide-Open-Source-2-6-Beta-1-released-tp5139071p5147066.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list