[OpenLayers-Users] Layer.MapServer.Untiled() Help

Christopher Schmidt crschmidt at metacarta.com
Sat Mar 3 21:15:53 EST 2007


On Sat, Mar 03, 2007 at 08:44:57PM -0500, Stephen Woodbridge wrote:
> Hi,
> 
> I have taken a shot at copying Layer/WMS/Untiled.js to 
> Layer/MapServer.Untiled.js and modifying it, but alas it does not work 
> and I'm not seeing the error of my ways.
> 
> http://imaptools.com/ol-test.html
> 
> It is built on OpenLayers-2.3 and loads the release OpenLayers.js and 
> also loads http://imaptools.com/ol/lib/OpenLayers/Layer/MapServer/Untiled.js
> 
> It says "this.tileSize has no properties"
> 
> OpenLayers.js (line 415)
> init()ol-test.html (line 56)
> onload(load )ol-test.html (line 1)
> [Break on this error] map_size:this.tileSize.w+'+'+this.tileSize.h,
> Untiled.js (line 187)
> 
> 183 getURL: function(bounds) {
> 184 var url = this.getFullRequestString(
> 185 {mapext:bounds.toBBOX().replace(/,/g,"+"),
> 186 imgext:bounds.toBBOX().replace(/,/g,"+"),
> 187 map_size:this.tileSize.w+'+'+this.tileSize.h,
> 188 imgx: this.tileSize.w/2,
> 189 imgy: this.tileSize.h/2,
> 190 imgxy: this.tileSize.w+"+"+this.tileSize.h
> 191 });
> 192 return url;
> 193 },
> 
> So how does this.tileSize get set in WMS.Untiled? and how should this be 
> getting set in the MapServer.Untiled object.

getURL in WMS.Untiled has this:
    getURL: function(bounds) {
            var tileSize = this.map.getSize();
            tileSize.w = tileSize.w * this.ratio;
            tileSize.h = tileSize.h * this.ratio;

You should probably change the this.tileSize in getURL in the
MapServer.Untiled layer to behave in a similar way. (On other layer
types, this.tileSize would probably be set somewhere in the initializer,
but since the tileSize for Untiled layers can change with every call if
the map window size changes, this isn't appropriate.)

Does that help?

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list