Arnd, 

Thanks very very much for your help, the map is show, as you said I forgot to 
insert a projection block.

My finaly objetive is obtain one maps change the sld_body params, but its don't 
affect the maps.

This is part of my code 
***********************
 function init(){
   var options = {
   projection: new OpenLayers.Projection("EPSG:4267"),
   displayProjection: new OpenLayers.Projection("EPSG:4267"),
   units: 'degrees',
   maxResolution: 0.05115824837085553,
   maxExtent: new 
OpenLayers.Bounds(-86.09240990784447,19.463031059956343,-72.99589832490545,23.634939943479928),
   controls : []
   };

   map = new OpenLayers.Map('map',options); 
       
             // setup single tiled layer
  
     layer0 = new OpenLayers.Layer.WMS( 
     
"Cuba","http://urano/cgi-bin/mapserv.exe?map=d:/ms4w/apps/OpenLayers/data/educacion.map";,
           {    layers: "Cuba",
                format: "image/png",
                 transparent: 'true'    
           });
     
             layer0.isBaseLayer=true;
   
            map.addLayers([layer0]);
            
            // setup controls and initial zooms
            map.addControl(new OpenLayers.Control.PanZoomBar());
            map.addControl(new OpenLayers.Control.Navigation());
            map.addControl(new OpenLayers.Control.Scale($('scale')));
            map.addControl(new 
OpenLayers.Control.MousePosition({element:$('location')}));
            map.addControl(new OpenLayers.Control.LayerSwitcher());
       }  
      
function Mostrar()
{
 map.layers[0].mergeNewParams({SLD_BODY:'<StyledLayerDescriptor 
version%3D"1.0.0"><UserLayer><Name>topp:cuba</Name><UserStyle><Name>UserSelection</Name><FeatureTypeStyle><Rule><Filter
 
xmlns:gml%3D"http://www.opengis.net/gml";><PropertyIsEqualTo><PropertyName>codprov</PropertyName><Literal>pinar</Literal></PropertyIsEqualTo></Filter><PolygonSymbolizer><Fill><CssParameter
 
name%3D"fill">%23FF0000</CssParameter></Fill></PolygonSymbolizer></Rule><Rule><LineSymbolizer><Stroke/></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></UserLayer></StyledLayerDescriptor>'});

}

Best Regards,

Salas


*************** 



  ----- Original Message ----- 
  From: Arnd Wippermann 
  To: 'fsalas' 
  Sent: Friday, September 18, 2009 1:50 PM
  Subject: AW: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer


  Hi salas,

  as the message says, you have forgotten to insert a projection block in the 
mapfile on map level.

    PROJECTION
      'init=EPSG:4267'
    END

  Arnd



------------------------------------------------------------------------------
  Von: fsalas [mailto:fsa...@geocuba.cu] 
  Gesendet: Freitag, 18. September 2009 19:28
  An: Arnd Wippermann
  Betreff: Re: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer


  Arnd, the problem persist , I atach the imagen error and the map file and the 
html file.

  I don´t know how resolve this problem, can you chek this files?



  Regards , salas

  ----- Original Message ----- 

  From: "Arnd Wippermann" <arnd.wipperm...@web.de>
  To: "'fsalas'" <fsa...@geocuba.cu>
  Sent: Friday, September 18, 2009 10:28 AM
  Subject: AW: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer


  Hi salas,

  Now have a look at your OpenLayers code. I suggest, that you have no options
  set for your map.

              var options = {
                  projection: new OpenLayers.Projection("EPSG:900913"),
                  displayProjection: new OpenLayers.Projection("EPSG:4326"),
                  units: "m",
                  numZoomLevels: 18,
                  maxResolution: 156543.0339,
                  maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
  20037508, 20037508.34),
                  controls      : []
              };

              map = new OpenLayers.Map('map', options); 

  It is an example for the google projection.

  Arnd

  -----Ursprüngliche Nachricht-----
  Von: fsalas [mailto:fsa...@geocuba.cu] 
  Gesendet: Freitag, 18. September 2009 18:14
  An: Arnd Wippermann
  Cc: users@openlayers.org
  Betreff: Re: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer

  Arnd,

  I don't Know why in WMS request ,the EPSG is different of 2085, Its
  EPSG:4326

  ----- Original Message -----
  From: "Arnd Wippermann" <arnd.wipperm...@web.de>
  To: "'fsalas'" <fsa...@geocuba.cu>
  Sent: Friday, September 18, 2009 9:06 AM
  Subject: AW: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer


  Hi,

  You have not added the projection block to the layer. Perhaps it is needed,
  i'm not sure. I declare always a projection for the map (as default output),
  and for the layers (the data have to be in a specific projection).

  If the problem remain, do the next:

  The message comes, when the WMS requests for an EPSG, that is not declared
  in the wms_srs tag. Have you in OpenLayers the projection for the map set to
  EPSG:2085. For the layer you need not declare the SRS, because OpenLayers
  add the EPSG from the map to the SRS parameter for the WMS layer.

  Use right click on your map to get the url for one tile of your WMS. Paste
  the url into the addressbar of your browser. The errormessage should be the
  same. But now you can inspect the WMS request. Look at the SRS. Is it
  &SRS=EPSG:2085?

  Arnd

  -----Ursprüngliche Nachricht-----
  Von: fsalas [mailto:fsa...@geocuba.cu]
  Gesendet: Freitag, 18. September 2009 16:31
  An: Arnd Wippermann
  Betreff: Re: [OpenLayers-Users] HELP!!! How implement Filter in WMS Layer

  Arn , I make your suggestion in my map file but the problem persist

  I atach my map file and the error image

  regards salas

  ___________________________________
  Dirección de Comunicaciones
  Grupo Empresarial GEOCUBA
  Este mensaje esta libre de virus.
  Revisado por Kaspersky Antivirus
  ----------------------------------------------------------------------
  Definition count:  2596814
  Definition date:  9/18/2009
  SecurityPlus version: 3.0.5




  ___________________________________
  Dirección de Comunicaciones
  Grupo Empresarial GEOCUBA
  Este mensaje esta libre de virus. 
  Revisado por Kaspersky Antivirus
  ----------------------------------------------------------------------
  Definition count:  2596814
  Definition date:  9/18/2009
  SecurityPlus version: 3.0.5




  ___________________________________
  Dirección de Comunicaciones
  Grupo Empresarial GEOCUBA
  Este mensaje esta libre de virus. 
  Revisado por Kaspersky Antivirus
  ----------------------------------------------------------------------
  Definition count: 2596814 Definition date: 9/18/2009 SecurityPlus version: 
3.0.5 


___________________________________
Dirección de Comunicaciones
Grupo Empresarial GEOCUBA
Este mensaje esta libre de virus. 
Revisado por Kaspersky Antivirus
----------------------------------------------------------------------
Definition count:  2596814
Definition date:  9/18/2009
SecurityPlus version: 3.0.5

_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to