[OpenLayers-Dev] GeoWebCache layer

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Tue Nov 23 02:40:02 EST 2010


See also:

http://dev.openlayers.org/sandbox/tschaub/gwc/lib/OpenLayers/Layer/GeoWebCache.js

Best regards,
Bart

> Iván, this looks pretty cool. Is there any reason not to rename the layer
> to OpenLayers.Layer.GeoWebCache? I'd recommend doing so, and then filing a
> ticket in Trac for inclusion in OpenLayers.
>
> SDE
>
> On Nov 22, 2010, at 2:39 PM, Iván Sánchez Ortega wrote:
>
>> Hi all,
>>
>> I'm working in a project that involves running GeoServer+GeoWebCache to
>> generate a whole bunch of tiles, then copying all the unmodified cached
>> tiles
>> to a frontend., then put openlayers on top.
>>
>> The trick is that GWC's way of naming cached tiles looks like this:
>>
>> EPSG_$projection_$namespace_$layer_08/05_04/0161_0146.png
>>
>> Here, 08 is z, 0161 is x, and 0146 is y. But the zero-padding and that
>> mid-level directory prevents us from using XYZ or TMS.
>>
>>
>> Worry no more! The brand-new GWC layer allows to load a mirrored copy of
>> GWC's
>> tile cache with no hassle, even accounting for GWC's bugs! Looky here:
>> http://ivan.sanchezortega.es/GWC.js
>>
>>
>> Usage is pretty straightforward:
>>
>> 	var gwc = new OpenLayers.Layer.GWC({});
>>
>> 	gwc.url = "path_to_cache_dir/EPSG_12345_namespace_layer_";
>> 	gwc.type = 'png';
>> 	gwc.name = "foobar"
>>
>> 	map.addLayer(gwc);
>>
>> Best,
>> --
>> ----------------------------------
>> Iván Sánchez Ortega <ivan at sanchezortega.es> <ivan at geonerd.org>
>>
>> http://ivan.sanchezortega.es
>> Proudly running Debian Linux with 2.6.35-trunk-amd64 kernel, KDE 3.5.10,
>> and
>> PHP 5.3.3-4 generating this signature.
>> Uptime: 23:28:21 up 22 days, 10:10,  6 users,  load average: 2.38, 2.04,
>> 1.47
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>




More information about the Dev mailing list