Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've grouped some vector layers (from SHP files) in GeoServer (they are EPSG:2039) and created cache for them (GeoWebCache lets you choose EPSG:4326 OR EPSG:900913) Once I've fired my App it didn't seem to read the cached tiles from the WMS (although they were created in the hard drive folder)

Could it be that because of the map projection the tiles are not being read ? (In the hard drive they are stored under EPSG_4326 folder)

This is how I init my map :

function init() {
        // if this is just a coverage or a group of them, disable a few items,
        // and default to jpeg format
        format = 'image/png';

        var bounds = new OpenLayers.Bounds(
            155000, 600000,
            246000, 745000
        );
        var options = {                
            maxExtent: bounds,
            maxResolution: 566.40625,
            projection: "EPSG:2039",
            units: 'm'
        };
        map = new OpenLayers.Map('map', options);

        // setup tiled layer
        tiled = new OpenLayers.Layer.WMS(
            "background", "http://localhost:8080/geoserver/MyWorkspace/wms",
            {
                LAYERS: 'background',                    
                format: format,
                tiled: true,
                tilesOrigin: map.maxExtent.left + ',' + map.maxExtent.bottom
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: true,
                yx: { 'EPSG:2039': false }
            }
        );

        map.addLayer(tiled);

        // build up all controls
        map.addControl(new OpenLayers.Control.LayerSwitcher());
        map.addControl(new OpenLayers.Control.PanZoomBar());
        map.addControl(new OpenLayers.Control.Navigation());
        map.addControl(new OpenLayers.Control.Scale());
        map.addControl(new OpenLayers.Control.MousePosition());
        map.setCenter(new OpenLayers.LonLat(200300,745000),7);            
    }        
share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If you want to cache tiles in projections other than the two defaults (4326, 900913) then you need to define a custom gridset with the new projection so that tiles in that projection are created.

The process is a little bit involved but is explained at http://geowebcache.org/docs/current/configuration/layers/projections.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.