[OpenLayers-Users] OL 2.11 problem with TileCache overlays on Google v2 base layer

Derek Watling derek at cmainfo.co.za
Mon Sep 12 08:05:03 EDT 2011


I have been using OpenLayers since 2.07 and am currently using 2.10. This
morning I downloaded 2.11 changed the references to the .css and .js files
and ran a test.

I have a TileCache base layer and a number of TileCache overlays, together
with the option of using Google base layers (API v2). After pointing to the
OL 2.11 code my overlays display "pink tiles" when one of the Google base
layers is selected.

On closer inspection I see that the calls to my own tiles are something
like:
http://cache.cmatile.co.za/CMCStreetNumbers/-1/000/000/432/000/000/413.png
with the zoom level becoming "-1"!

I have tested in IE 9 and Firefox 6 with the same result.

The current working version using OL 2.10 can be viewed at 
http://www.cmainfo.co.za/ www.cmainfo.co.za .

Below is the relevant code from the page:

<link rel="stylesheet" href=
"/JavaScript/OpenLayers211/theme/default/style.css" type="text/css" />


...
// My base layer
cmaBase = new OpenLayers.Layer.TileCache(
    "CMA Info - Streets",
    "http://cache.cmatile.co.za/",
    "CMCBase",
    { isBaseLayer: true, format: "image/gif", serverResolutions:
[152.87405654296876, 76.43702827148438, 38.21851413574219,
19.109257067871095, 9.554628533935547, 4.777314266967774, 2.388657133483887,
1.1943285667419434, 0.5971642833709717, 0.29858214168548586], buffer: 0 }
);
cmaBase.setOpacity(1);
cmaBase.setVisibility(true);
cmaBase.displayOutsideMaxExtent = 0;
map.addLayers([cmaBase]);

// Google base layer
ghyb = new OpenLayers.Layer.Google("Google - Satellite & Streets", {
"sphericalMercator": true, type: G_HYBRID_MAP });
ghyb.MIN_ZOOM_LEVEL = 10;
ghyb.MAX_ZOOM_LEVEL = 19;
map.addLayers([ghyb]);
map.setBaseLayer(ghyb);

// My overlay
cmaStreetNo = new OpenLayers.Layer.TileCache(
    "Street Numbers",
    "http://cache.cmatile.co.za/",
   "CMCStreetNumbers",
    { isBaseLayer: false, format: "image/png", serverResolutions:
[1.1943285667419434, 0.5971642833709717, 0.29858214168548586], resolutions:
[1.1943285667419434, 0.5971642833709717, 0.29858214168548586], buffer: 0 }
);
cmaStreetNo.setOpacity(1);
cmaStreetNo.setVisibility(true);
cmaStreetNo.displayOutsideMaxExtent = 0;
map.addLayers([cmaStreetNo]);


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OL-2-11-problem-with-TileCache-overlays-on-Google-v2-base-layer-tp6783165p6783165.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list