[OpenLayers-Users] HELP!!! How implement Filter in WMS Layer
Arnd Wippermann
arnd.wippermann at web.de
Fri Sep 18 16:40:33 EDT 2009
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&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,2
3.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/ed
ucacion.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>UserSele
ction</Name><FeatureTypeStyle><Rule><Filter
xmlns:gml%3D"http://www.opengis.net/gml" <http://www.opengis.net/gml>
><PropertyIsEqualTo><PropertyName>codprov</PropertyName><Literal>pinar</Lite
ral></PropertyIsEqualTo></Filter><PolygonSymbolizer><Fill><CssParameter
name%3D"fill">%23FF0000</CssParameter></Fill></PolygonSymbolizer></Rule><Rul
e><LineSymbolizer><Stroke/></LineSymbolizer></Rule></FeatureTypeStyle></User
Style></UserLayer></StyledLayerDescriptor>'});
}
Best Regards,
Salas
***************
----- Original Message -----
From: Arnd <mailto:arnd.wippermann at web.de> Wippermann
To: 'fsalas' <mailto: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" < <mailto:arnd.wippermann at web.de>
arnd.wippermann at web.de>
To: "'fsalas'" < <mailto:fsalas at geocuba.cu> 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: <mailto:users at openlayers.org> 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" < <mailto:arnd.wippermann at web.de>
arnd.wippermann at web.de>
To: "'fsalas'" < <mailto:fsalas at geocuba.cu> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090918/b95266cc/attachment.html
More information about the Users
mailing list