[OpenLayers-Dev] tilecache + google

Steven M. Ottens steven at minst.net
Wed Jul 25 04:15:07 EDT 2007


Great work, the dev-example works smoothly.
However if I try it with my own tilecache I get errors at some zoomlevels:
[ahn-merc]
type=WMSLayer
url=http://steef/cgi-bin/edugis/mapserv.cgi?map=maps/edugis/hoogte.map&transparent=true
layers=hoogtes
extension=png
bbox=-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892
maxResolution=156543.0339
srs=EPSG:54004
extent_type=loose # this is needed for the wrapDateLine stuff.

<script type="text/javascript">
        <!--
        var map, gmap, merc;

        function init(){
            var options = {
                projection: "EPSG: 54004",
                units: "m",
                maxResolution: 156543.0339,
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508.34)
            };
            map = new OpenLayers.Map('map', options);

            gmap = new OpenLayers.Layer.GoogleMercator("Google");
            var wms = new OpenLayers.Layer.WMS( "World Map", 
         "http://steef/tilecache.py?transparent=true", 
                 {layers: 'ahn-merc', 'format':'png'}, {'reproject': false, isBaseLayer: false, 'wrapDateLine': true} );
            
            map.addLayers([gmap, wms]);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.zoomToMaxExtent()
            
        }

    // -->

    </script>

I get a tilecache error:

An error occurred: can't find resolution index for 76.437028. Available resolutions are: 
[156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001, 9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501, 611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586]

So somehow, there a slight difference in my TileCache and the one used 
in the dev demo or in my openlayers and the one on the server. However, 
I updated the sandbox yesterday afternoon and I use TileCache 1.9RC2

A more worrying thing however:
There's a huge memory leak, check the memory usage if you zoom in and 
out a couple of zoomlevels. It goes up really fast.

Steven

Christopher Schmidt wrote:
> tilecache + google:
>
> http://dev.openlayers.org/sandbox/crschmidt/google/examples/google-factbook-tc.html
>
> proj4 text on the server:
>
> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0
> +k=1.0 +units=m +nadgrids=@null +no_defs
>
> (from last question on http://proj.maptools.org/faq.html)
>
> TileCache config on the server: 
>
> [factbook-overlay]
> type=WMSLayer
> url=http://localhost/cgi-bin/mapserv?transparent=true&map=/www/freemap.in/world/map/factbooktrans.map
> layers=factbook
> bbox=-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892
> maxResolution=156543.0339
> srs=EPSG:54004
> extent_type=loose # this is needed for the wrapDateLine stuff.
>
> As you can see on the example, both TMS and WMS work fine. 
>
> This code is not in trunk yet. It's using the GoogleMercator branch,
> which means that when you 'setCenter', you do it in projected
> coordinates, not in lonlat. However, it does demonstrate that it's
> possible to do tilecache over google with no changes to TileCache, for
> those of you who might be interested in such a thing.
>
> This should be in 2.5.
>
> Regards,
>   






More information about the Dev mailing list