[OpenLayers-Users] Tips on using GeoWebCache 1.5.0 gwc on Geoserver 2.4.1
GeoGEOrge
awmlamp at yahoo.com
Wed Dec 11 07:44:38 PST 2013
I am having trouble getting GeoServer Virtual OWS services to make use of
GeoWebCache.
The layers displays, but the performance is very slow.
I decided to try having my OpenLayers javascript web map call directly to
gwc, rather than relying on GeoServer WMS Direct Integration to relay the
call to gwc.
The two documentation pages below describe the process.
I have added a few details that took me quite a while to figure out.
------------
http://docs.geoserver.org/latest/en/user/geowebcache/using.html
GeoWebCache endpoint URL
When not using direct integration, you can point your client directly to
GeoWebCache.
To direct your client to GeoWebCache (and thus receive cached tiles) you
need to change the WMS URL.
You can invoke the GeoWebCache WMS instead at this URL:
http://example.com/geoserver/gwc/service/wms
-------------
http://geowebcache.org/docs/current/services/wms.html
Manual Configuration of OpenLayers
The easiest way to create an OpenLayers client is to copy the source from
one of the automatically generated demos. To ensure that requests match the
underlying grid properly you must pay particular attention to the map
options resolutions, projection and maxExtent.
Note that in current versions of OpenLayers the baselayer has a special
meaning, hence certain parameters may be quitely ingored if you transfer a
layer from the demo applications into an existing application.
-------------
get the source code from a gwc demo page:
Geoserver administration > Tile caching - Caching Defaults > Go To embedded
GeoWebCache home page > list of all layers and automatic demos
select a layer/format
copy the page source
make the following changes to the html:
change to location/version of OpenLayers on your server
Demo source code:
change the URL to your server:
Demo Source code: "../service/wms"
change to : "http://172.17.0.101/geoserver/gwc/service/wms"
comment out the following lines (add // to the begining) that do not work
because $ is not defined:
//map.addControl(new OpenLayers.Control.Scale($('scale')));
//map.addControl(new OpenLayers.Control.MousePosition({element:
$('location')}));
At this point I am able to open the html in a browser and see the layer,
with performance fast enough to believe that I am seeing cached tiles.
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Tips-on-using-GeoWebCache-1-5-0-gwc-on-Geoserver-2-4-1-tp5092386p5093778.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list