[OpenLayers-Dev] GeoWebCache and fractionalZoom: addin or feature proposal

Marc Jansen jansen at terrestris.de
Thu Oct 8 17:14:59 EDT 2009


Hi Andreas,

hooking the changing of the URL to an appropriate event is a very good 
idea. I didn't think about that. So maybe we'll change it that way 
around. Yet this would mess up the map instantiation code a little bit 
and I thought that having an option when generating the layer would be 
more crisp.

Regards and thanks (your ¢ are very much appreciated :-)),

Marc


Andreas Hocevar schrieb:
> Hey Marc,
>
> have you thought about a different patch, giving the map a "zoomstart" 
> or "beforezoom" event? You could then register for this event and call 
> layer.setURL with the WMS url when the zoom is fractional, and with 
> the GWC url when it is integer. This seems easier and more useful to me.
>
> Just my 2¢
> Andreas.
>
> Marc Jansen wrote:
>> Hi devs,
>>
>> we develop an OpenLayers application that uses WMS-tiles generated by 
>> GeoWebCache. But we have the need to allow fractionalZoom as well, 
>> because the application will sometimes zoom to non-integer scales 
>> (when we highlight search results, for instance). Without a change to 
>> the code of OpenLayers these fractional zoomlevels mess up the map 
>> (because right now GeoWebCache does not act as WMS when being asked 
>> for tiles it cannot provide).
>>
>> For the application in question we patched OpenLayers/Layer/WMS.js to 
>> have an option to use a different baseURL when fractional zoomlevels 
>> are needed. So when map.zoom is non-integer, we ask the original 
>> WMS-Server for slow but correct tiles.
>>
>> I am not sure whether this is possibly a addin, or an additional 
>> option for WMS-layers. What do you think?
>>
>> The code in question would introduce a new property 
>> "alternativeFractionalZoomURL" (name of course TBD) to 
>> OpenLayers.Layer.WMS-objects and one additional check in the 
>> WMS.getURL-method (if the map allows fractional zoomlevels AND if the 
>> alternativeFractionalZoomURL is not empty AND the current map.zoom is 
>> fractional THEN use the altURL, behave as always in any other case). 
>> Does this break code elsewhere? We did not have the time to run the 
>> tests up until now, but maybe you see problems early at this stage.
>>
>> Regards and thanks for any comments,
>> Marc
>>
>> BTW: the new WMS.Post layer looks really promising! Great work!
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>   
>
>




More information about the Dev mailing list