[OpenLayers-Users] TMS Layers always added as Baselayers

Christian Ledermann christian.ledermann at gmail.com
Mon Dec 10 01:13:01 PST 2012


Hello,

I defined my TMS layers as

{layers: [
function(){return new
OpenLayers.Layer.TMS('OpenStreetMap','http://tile.openstreetmap.org/',{'type':'png',getURL:
cgmap.osm_getTileURL,displayOutsideMaxExtent:true,numZoomLevels:19,attribution:'<a
href="http://www.openstreetmap.org/">OpenStreetMap</a>'});}
,
function(){return new OpenLayers.Layer.Google('Satellite
(Google)',{'type': google.maps.MapTypeId.SATELLITE,
numZoomLevels:22,'sphericalMercator':true});}
,

            function() {
                    return new
OpenLayers.Layer.TMS("OMI_Absorbing_Aerosol_Optical_Depth",
                    "http://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi",
                    {layername: 'OMI_Absorbing_Aerosol_Optical_Depth',
type:'png'},
                    {isBaseLayer: true });
                    },
            function() {
                    return new OpenLayers.Layer.TMS("MODIS_Land_Water_Mask",
                    "http://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi",
                    {layername: 'MODIS_Land_Water_Mask', type:'png'},
                    {isBaseLayer: false });
                    },
            function() {
                    return new OpenLayers.Layer.TMS("MODIS_Aqua_Aerosol",
                    "http://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi",
                    {layername: 'MODIS_Aqua_Aerosol', type:'png'},
                    {isBaseLayer: false });
                    }

                    ]}


What I expect is that the layers MODIS_Aqua_Aerosol,
MODIS_Land_Water_Mask are added as overlays so i can check uncheck
them in the layerswitcher
what happens is that all layers are added as Baselayers so
the layerswitcher has just radio buttons

Q: How can I add TMS Layers as overlays? The above looks right to me
and is what i could make out of the documentation and examples



--
Best Regards,

Christian Ledermann

Nairobi - Kenya
Mobile : +254 702978914

<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>


More information about the Users mailing list