[Tilecache] google maps (900913) and tilecache with openlayers as the client

Ivan Price gunn.point at gmail.com
Sun Sep 14 10:33:47 EDT 2008


Hi there..

I have an openlayers application overlaying some WMS layers (that i am
serving locally from geoserver) over the top of google maps.
Everything is running perfectly there using the " 'sphericalMercator':
true" parameter in the googlemaps layers' config.

What I am trying to do now is point openlayers at my tilecache instead
of directly to geoserver for my local wms layers. I have previously
got this working no worries when no google layers were involved.  I
have read a lot of information about getting tilecache to work when
using google maps as the client, but is it able to request tiles when
openlayers is the client (and google is involved) ? I have aligned the
'resolutions' parameter between openlayers and tilecache, and used the
tms_type and spherical_mercator tags in TC but still tilecache
returns:

An error occurred: Current x value 8004688.542400 is too far from tile
corner x 7514065.626400

So the problem is aligning openlayers with tilecache.. but i can't see
what i'm missing. Is what i'm trying to do even possible ? Any
comments or suggestions would be greatly appreciated.

cheers,

-ivan


heres my tilecache config:

[landsat]
type=WMS
url=http://localhost:8080/geoserver/wms
extension=jpeg
resolutions=156543.033900000,78271.516950000,39135.758475000,19567.879237500,9783.939618750,4891.969809375,2445.984904688,1222.992452344,611.496226172,305.748113086,152.874056543,76.437028271,38.218514136,19.109257068,9.554628534,4.777314267,2.388657133,1.194328567,0.59716428337097171575,0.298582142
srs=EPSG:900913
maxResolution=156543.0339
bbox=-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892
tms_type=google
spherical_mercator=true
layers=xxxxx

openlayers layer config:

	map = new OpenLayers.Map('map', {
			controls: [],
			resolutions:
[156543.033900000,78271.516950000,39135.758475000,19567.879237500,9783.939618750,4891.969809375,2445.984904688,1222.992452344,611.496226172,305.748113086,152.874056543,76.437028271,38.218514136,19.109257068,9.554628534,4.777314267,2.388657133,1.194328567,0.59716428337097171575,0.298582142],
			projection: new OpenLayers.Projection("EPSG:900913"),
			displayProjection: new OpenLayers.Projection("EPSG:4326"),
			units: "m",
			maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
			numZoomLevels: 18,
			maxResolution: 156543.0339
	});

(cut)

	var layer_image_landsat = new OpenLayers.Layer.WMS(
		"Local Imagery", "/tilecache/tilecache.cgi",
		{
		        layers: 'landsat',
                        srs: 'EPSG:4326',
                        format: 'image/png',
			transparent:true
		},
		{ isBaseLayer: true, singleTile: false, opacity:1}
           );

(cut)



More information about the Tilecache mailing list