[Spanish] Ayuda Tilecache+mapserver+openlayers

Pedro-Juan Ferrer Matoses pferrer at osgeo.org
Thu Mar 21 08:22:55 PDT 2013


Esto lo tengo olvidadísimo (ahora mismo nos hemos pasado a MapProxy)
pero me suena que en el tilecache.cfg no necesitas definir el type
como {Mapserver,WMS}

Yo lo dejaría solo como WMS y quitaría el par mapfile=

En la configuración de Apache yo lo tenía montado así

                AllowOverride None
                AddHandler python-program .py
                PythonHandler TileCache.Service
                PythonOption TileCacheConfig /etc/tilecache.cfg
                Order deny,allow
                Allow from all

Pero sobretodo activa los logs de Apache y consultalos a ver si tienes
más información allí

On Wed, Mar 13, 2013 at 4:29 PM, Anderson castellanos
<castellanos825 en hotmail.com> wrote:
> Buenos dias he ralizado un servicio de mapas con mapserver (ms4w) y
> openlayers, sin embargo al tratar de integrar tilecache al mismo, he
> fracasado. he seguido las instrucciones de algunos foros pero sin éxito  por
> favor si alguien pudiera ayudarme estaria muy agradecido.
> estoy utilizando:
> Ms4w 3.0.4
> Openlayers 2.1.2
> Tilecache 2.11
> python 2.6.2
>
>
> archivo tilecache.cfg
>
> [cache]
> type=Disk
> base=C:/ms4w/tmp/tilecache
>
> [mapa]
> type={MapServer,WMS}
> mapfile=C:/ms4w/Apache/htdocs/map/mapfile4.map
> url=http://localhost:8080/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/htdocs/map/mapfile4.map
> layers=Provincias,PaisesVecinos,Rios,Lagos,Edificaciones,Calles,Corregimiento,Distritos
> extension=png
> size=256,256
> bbox=-89.512776,0.635665,-66.577208,12.207839
> srs=EPSG:4326
> levels=8
> resolutions=0.009,0.00813762678,0.0017525356000000000000,0.0009633874600000000000,0.0004128803400000000000,0.0000564401700000000000,0.0000412881622611744000,0.0000072346966
> extent_type=loose
>
>
> archivo httpd.conf
>
> <Directory "C:/ms4w/Apache/htdocs/tilecache/">
> AddHandler cgi-script .cgi
> Options +ExecCGI
> </Directory>
>
>
> archivo tilecache.cgi
>
> #!C:/Python26/python.exe?
>
> from TileCache import Service, cgiHandler, cfgfiles
>
> if __name__ == '__main__':
>     svc = Service.load(*cfgfiles)
>     cgiHandler(svc)
>
>
> Archivo Openlayers
>
>
>       var map ;
>         function init(){
>
> bounds = new OpenLayers.Bounds();
> bounds.extend(new OpenLayers.LonLat(-89.512776,0.635665));
> bounds.extend(new OpenLayers.LonLat(-66.577208,12.207839));
> var scale1 = 0.009;
> var scale2 = 0.00813762678;
> var scale3 = 0.0017525356000000000000;
> var scale4 = 0.0009633874600000000000;
> var scale5 = 0.0004128803400000000000;
> var scale6 = 0.0000564401700000000000;
> var scale7 = 0.0000412881622611744000;
> var scale8 = 0.0000072346966;
>   map_service =
> 'http://localhost:8080/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/htdocs/map/mapfile4.map';
>   map = new OpenLayers.Map(
> 'map',
> {
> units: "m",
> maxResolution: scale1,
> minResolution: 0.000007234696613999980,
> maxExtent: bounds,
> restrictedExtent: bounds,
> numZoomLevels: 8,
> controls: [new OpenLayers.Control.Navigation(),
>                                                          new
> OpenLayers.Control.PanZoomBar(),
> new OpenLayers.Control.MousePosition()],
> }
> );
>
>
> ingeomaps_layer0 =new OpenLayers.Layer.WMS(
> "L0",//'http://127.0.0.1?' ,
> map_service,
> {
> layers:
> 'Basef',
> transparent: 'false',
> format: 'gif'
> },
> {
> isBaseLayer:true,
> visibility:false
> }
> );
> ingeomaps_layer0.setVisibility(false);
>
> // registerEvents(ingeomaps_layer0);
> ingeomaps_layer1 =new OpenLayers.Layer.WMS(
> "L1",
> map_service,
> {
> layers:
> 'PaisesVecinos'+
>                                                 ',PaisesVecinos_txt'+
> ',Provincias'+
> ',Provinciastxt'+
> ',Parques'+
> ',Calles'+
> ',Lagos',
> transparent: 'true',
> format: 'png'
> },
> {
> isBaseLayer:false, transitionEffect: 'resize',visibility:true,
> minResolution: scale2,
> maxResolution: scale1
> }
> );
> ingeomaps_layer2 =new OpenLayers.Layer.WMS(
> "L2",
> map_service,
> {
> layers:
> 'PaisesVecinos'+
> ',PaisesVecinos_txt'+
> ',Provincias'+
> ',Provinciastxt'+
> ',Distritostxt'+
> ',Parques'+
> ',Calles'+
> ',Lagos',
> transparent: 'true',
> format: 'png'
> },
> {
> isBaseLayer:false, transitionEffect: 'resize',visibility:true,
> maxResolution: scale2,
> minResolution: scale3
> }
> );
>                                                         .
>                                                         .
>                                                         .
>                                                         .
>
>                           map.addLayers([ingeomaps_layer0,ingeomaps_layer1,
> ingeomaps_layer1_1, ingeomaps_layer2 ....]);
>                                   if (!map.getCenter()) {
> map.zoomToMaxExtent();
> }
>
> Al abrir el mapa en el navegador no me genera genera las imagenes en disco,
> por lo tanto supongo que el principal problema es la configuración del
> tilecache.
>
>
> _______________________________________________
> Spanish mailing list
> http://lists.osgeo.org/mailman/listinfo/spanish
> http://es.osgeo.org
> http://twitter.com/osgeoes
>



-- 
Pedro-Juan Ferrer Matoses
Valencia (España)


More information about the Spanish mailing list