[OpenLayers-Users] HELP!!! How implement Filter in WMS Layer

Paul james pauljame at gmail.com
Mon May 3 10:38:54 EDT 2010


Hi Arnd...
I have some questions about that...

First I have a geo app using Openlayers/Mapserver WMS with SDE layers....
My application has a treeview with all layers, and a radiobox for each
layer... When I click in a layer´s radiobox a window with a GRID containing
all layer´s data is opened...
In that GRID, When I select a line (layer´s data), the Map should :
 1-) Highlight it
 2-) Zoom in data selected

Can I develope that using SLD and SLD_BODY ? Do you have any tip to how do
that?

Thanks

On Fri, Sep 18, 2009 at 5:40 PM, Arnd Wippermann <arnd.wippermann at web.de>wrote:

>  hi salas,
>
> you request the layer Cuba, but in the SLD_BODY you describe rules for the
> layer topp:cuba. Change it to Cuba. And if your SLD_BODY has escaped chars,
> change them too (%3D =, %23 #).
>
> you can try this
> <http://urano/cgi-bin/mapserv.exe?map=d:/ms4w/apps/OpenLayers/data/educacion.map>
> http://urano/cgi-bin/mapserv.exe?map=d:/ms4w/apps/OpenLayers/data/educacion.map<http://urano/cgi-bin/mapserv.exe?map=d:/ms4w/apps/OpenLayers/data/educacion.map&Service=WMS&Version=1.1.1&Request=GetStyles&Layers=Cuba>
> &Service=WMS&Version=1.1.1&Request=GetStyles&Layers=Cuba
>
> to get a sld file for the layer defined by the mapfile .
>
> Arnd
>
>  ------------------------------
> *Von:* fsalas [mailto:fsalas at geocuba.cu]
> *Gesendet:* Freitag, 18. September 2009 23:15
>
> *An:* Arnd Wippermann
> *Cc:* users at openlayers.org
> *Betreff:* Re: [OpenLayers-Users] HELP!!! How implement Filter in WMS
> Layer
>
>  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<http://www.opengis.net/gml%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ecodprov%3C/PropertyName%3E%3CLiteral%3Epinar%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E%3CPolygonSymbolizer%3E%3CFill%3E%3CCssParameter>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 <arnd.wippermann at web.de>
> *To:* 'fsalas' <fsalas at geocuba.cu>
> *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:fsalas at 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.wippermann at web.de>
> To: "'fsalas'" <fsalas at 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:fsalas at geocuba.cu]
> Gesendet: Freitag, 18. September 2009 18:14
> An: Arnd Wippermann
> Cc: users at 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.wippermann at web.de>
> To: "'fsalas'" <fsalas at 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:fsalas at 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 at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100503/17fca8c5/attachment.html


More information about the Users mailing list