[OpenLayers-Dev] grid layout calculation magic or something like
that
BrainDrain
paulborodaev at gmail.com
Thu Mar 19 02:55:21 EDT 2009
Hi.
I'm trying to enable client browser caching for my app via constant url's to
mapserver tiles.
For certain mapserver state (state => hash key as url parameter - crc32 of
config/SLD), using some custom url schema (instead of mapserv cgi parameters
schema) and my http handler, I can achieve that.
But as I can see OL.layer.mapserver mapext, imgext url parameters are
slightly (in my case 11-12 sign) different from time to time (from one web
app initializing to another). How can I fix that? I suppose the problem is
in initGriddedTiles method ('heaven help us' in comments!)))) or in
calculateGridLayout. May be this is related to rounding. Unfortunately I
haven't time to dig into the code and currently I'm using temp solution:
(function() {
OpenLayers.Layer.MapServer.prototype.getURL = function(bounds) {
bounds = this.adjustBounds(bounds);
//---------------------------------------------------------------------------------
var extent = [parseFloat(bounds.left.toFixed(10)),
parseFloat(bounds.bottom.toFixed(10)), parseFloat(bounds.right.toFixed(10)),
parseFloat(bounds.top.toFixed(10))];
//---------------------------------------------------------------------------------
var imageSize = this.getImageSize();
return this.getFullRequestString({
mapext: extent,
imgext: extent,
map_size: [imageSize.w, imageSize.h],
imgx: imageSize.w / 2,
imgy: imageSize.h / 2,
imgxy: [imageSize.w, imageSize.h]
});;
};
})();
--
View this message in context: http://n2.nabble.com/grid-layout-calculation-magic-or-something-like-that-tp2501470p2501470.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.
More information about the Dev
mailing list