On Thu, Mar 18, 2010 at 8:50 PM, Eric Lemoine
<[email protected]> wrote:
> On Thu, Mar 18, 2010 at 2:58 PM, Alexandre Dube <[email protected]> wrote:
>> Hi Devs,
>
> Hi Alexandre,
>
>>
>> I'd like to have comments on one matter. I thing this could be a
>> OpenLayers-dev thread but I'm not sure. Please let me know.
>>
>> *Problem*
>> When adding WMS layers using the WMSCapabilitiesStore widget, their
>> tile size is set to 256x256 (OpenLayers' default value). Please correct
>> me if I'm wrong, but I noticed that using tiles rather than singleTile
>> for WMS layers is slower.
>
> when there's no tile cache, yes.
>
>> *More info*
>> So, for performance reason, I'd rather go with a singleTile: true
>> option but since it's possible that the tile generated exceeds the
>> maxWidth/Height of the WMS server, we can't use that solution. The only
>> way to know would be to use WMS version 1.3.0 where we do know
>> maxWidth/Height in the service tag. At this point, we could do something.
>
> I didn't know about maxWidth/Height in 1.3.0, thanks for the information.
>
>>
>> *Solution*
>> How about this :
>> If using 1.3.0, layers could be created normally with the 256x256 tile
>> size (because at this point it's not yet linked to any map so it's not
>> yet the time to play around the tile size) and we could store the
>> maxHeight and maxWidth as new layer options. Then, when the layer is
>> added to a map, we could check these values. If the (map size * ratio
>> of the singletile) is smaller than maxWidth/Height, then set singleTile
>> to true.
>>
>> Every time the map is resized, we need to check the above condition
>> again. If it becomes false, set the singleTile to false and set the
>> tile size to maxHeight and maxWidth. I'm not sure if this kind of "on
>> map size changed" event could be possible since in OpenLayers you can't
>> register a map "resize" event. It needs to be done manually with the
>> updateSize method that calls each layer onMapResize methods so they
>> would need to be modified.
>>
>> How about if maxWidth/Height of a WMS layer is set, do the above ? If
>> we don't want that to always happen, we could add a flag to trigger this
>> when set to true.
>>
>> Any thoughts ?
>
> I personally don't like the idea of auto switching from
> singleTile:fase to singleTile:true and vice-versa. I'd prefer
> introducing a useMaxTileSize boolean option to OpenLayers.Layer. When
> useMaxTileSize is true, and when maxHeight and maxWidth are specified
> in the layer, the tile size will be set to (maxHeight, maxWidth), no
> matter the value of tileSize.
actually: no matter the values of singleTile and tileSize.
> If maxHeight and maxWidth are not
> specified then useMaxTileSize will have no effect.
>
> So in your case I guess you would use {singleTile: true, useMaxTileSize:
> true}.
>
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Dev mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/dev