[Spanish] TileCache - MapServer - OpenLayer - Windows XP -

Guzman drejon at auna.com
Mon Jun 30 13:23:59 EDT 2008


Buenos días, estoy intentando configurar Tile-Cache con MapServer y 
OpenLayer pero por ahora solo queda en el intento.

Mi configuración es la siguiente:

Apache
Mapserver
tilecache  2.04
python-2.5.2
Windows XP

Los ficheros de configuración son:

tilecache.cfg:

[Alaska]
type=WMSLayer
mapfile=C:/ms4w/apps/ka-map-1.0/gmap/mapas/gmap75.map
extension=png
size=256,256
bbox=-2200000, -712631, 3072800, 3840000
resolutions=10583.
327618336418,5291.663809168209,3527.775872778807,2645.8319045841044,1763.8879363894034,881.9439681947017,529.166380916821,352.7775872778807,264.5831904584105,17.63887936389403,8.819439681947015,5.291663809168209,3.527775872778806,2.6458319045841043,1.763887936389403,0.8819439681947016,0.35277758727788067
layers=bathymetry,land_fn
srs=EPSG:42304
extent_type=loose

Nota*: El campo resolutions lo he sacado usando el procedimiento que 
describiste más arriba 

Fichero de mapas: gmap75.map

#
# Start of GMAP map file
#
#
NAME GMAP_DEMO
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.sym
EXTENT -2200000 -712631 3072800 3840000
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt

# PROYECCIÓN  UTM
  PROJECTION
    "init=EPSG:42304"  
  END
#
# Start of web interface definition
#
WEB
  MINSCALE 2000000
  MAXSCALE 50000000
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the 
root
# of the drive where the .MAP file resides.
#
  IMAGEPATH "/ms4w/tmp/ms_tmp/"
  IMAGEURL "/ms_tmp/"
 
  METADATA
      "wms_title"                    "Alaska"
            "wms_onlineresorce" "http://127.0.0.1/cgi-bin/mapserv.exe?
map=C:/ms4w/apps/ka-map-1.0/gmap/mapas/gmap75.map&"
            "wms_srs"                        "EPSG:42304"
  END
END
.......................

 Fichero index.html

  <script type="text/javascript">
            var map;
            function init(){
          
                            map = new OpenLayers.Map('map',
                                             { controls: [
                                             new OpenLayers.Control.
PanZoomBar(),
                                             new OpenLayers.Control.
MouseDefaults(),
                                             new OpenLayers.Control.
MousePosition(),
                                             new OpenLayers.Control.
OverviewMap(),
                                             new OpenLayers.Control.
Permalink,
                                             new OpenLayers.Control.
LayerSwitcher
                                             ],
                                             units: 'm',
                                             projection: 'epsg:42304',
                                             //maxResolution: 'auto',
                                             maxExtent: new OpenLayers.
Bounds( -2200000, -712631, 3072800, 3840000 ),
                                             scales: [ 
30000000,15000000,10000000,7500000,5000000,2500000,1500000,1000000,750000,50000,25000,15000,10000,7500,5000,2500,1000 
],
                                             minScale: 30000000,
                                             maxScale: 2500
                                             } );
                                
                                
                                       var urlArray = ["http:
//localhost/cgi-bin/mapserv.exe",
                                                                "http:
//127.0.0.1/cgi-bin/mapserv.exe"];
                                
                                      var ol_wms = new OpenLayers.
Layer.WMS( "OpenLayers WMS",
                    "http://labs.metacarta.com/wms/vmap0",
                    {layers: 'basic'} );
                    
                var jpl_wms = new OpenLayers.Layer.WMS( "Capa de 
Manzanas", urlArray,
                    {map:'C:/ms4w/apps/ka-map-1.0
/gmap/mapas/gmap75_wms.map',
                                        layers: 'bathymetry,land_fn',
format: "image/png"} );
                    
                 
                var dm_wms = new OpenLayers.Layer.WMS( "Tile Cache", 
"http://localhost/Openlayer/tilecache/tilecache.cgi?",
                    {layers: "Alaska", format: "image/png" });

                jpl_wms.setVisibility(true);
                ol_wms.setVisibility(false);
                dm_wms.setVisibility(false);

                map.addLayers([jpl_wms, dm_wms]);
                if (!map.getCenter()) map.zoomToMaxExtent();
                }
                                            
        </script>

Cuando uso el servicio WMS que conecta con: http://labs.metacarta.
com/wms/vmap0 se me generan en mi disco local las distintas celdas.

Cuando uso openLayer directamente contra mapserver también me 
funciona.

El problema esta cuando uso el servicio que ataca a tileCache (http:
//localhost/Openlayer/tilecache/tilecache.cgi?), todas la celdas se 
muestran de ese color que todos sabemos y estoy empezando a odiar.

He probado de todo y no consigo nada. Estaria muy agradecido si 
alguien me diese alguna pista para intentar arreglar el problema.

Saludos. 



More information about the Spanish mailing list