[OpenLayers-Users] pareInt in Grid.js

billChadwick w.chadwick at sky.com
Thu Oct 11 12:42:55 PDT 2012


There are several parseInt calls in grid.js in 2.12 that look to be missing
the second parameter of 10 to force decimal. Does anyone know if this is
intended or not ?

I'm chasing down patching grid.js to work with map resolution >
serverResolution (for retina type displays).

I have patched the start of initGriddedTiles thus

        var scale = this.getResolutionScale();

        var viewSize = this.map.getSize();
       
        var minRows = Math.ceil((viewSize.h/this.tileSize.h)/scale) + //
/scale is patch
                      Math.max(1, 2 * this.buffer);
        var minCols = Math.ceil((viewSize.w/this.tileSize.w)/scale) + //
/scale is patch
                      Math.max(1, 2 * this.buffer);

Without adding a call to moveGriddedTiles at the end of the function when
scale is < 1, I get a gap of a few tiles at the top and left of the screen.
With that extra call, all is fine and we can get a stunning map display on
an IPad3. For an example, see here
http://mortimermaps.appspot.com/demo/demo_hi.htm



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/pareInt-in-Grid-js-tp5008141.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list