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

Stephen Woodbridge woodbri at swoodbridge.com
Sat Mar 3 23:20:28 EST 2007


Christopher,

Thank you that did it. I had stupid cut and paste errors. Anyway, 
attached it a tarball with a working MapServer.Untiled.js and an example 
file. Please feel free to add these to the source tree. I pass whatever 
rights you need with respect to these files to incorporate them.

Thank you for all your efforts and all your support.

-Steve

Christopher Schmidt wrote:
> 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,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OL2.3-MapServer-Untiled.tgz
Type: application/x-compressed
Size: 2962 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070303/e229f5fe/OL2.3-MapServer-Untiled.bin


More information about the Users mailing list