floflo ha scritto:
ok thks but it keeps not working on my server...
it works on my local machine with geoserver 1.7.0 (windows) but not on my
server with 1.7.1 on linux..
from my windows local machine, i call this a page which load :
- wms from localhost (geoserver 1.7.0)
- SLD from remote server
it works (SLD process works on my windows machine, even with remote SLD)
it loads the map with the new SLD
tiled = new OpenLayers.Layer.WMS(
"communes", "http://localhost:8080/geoserver/wms",
{
layers: 'bl:communes',
syle:'',
SLD: 'http://172.31.172.244/myStyle.xml’
or SLD: 'http://localhost/myStyle.xml’
},
{buffer: 0}
but if i load
- wms from remote server
- SLD from remote server
it doesn't work..
it loads the map with the SLD put in geoserver and noway to change it
tiled = new OpenLayers.Layer.WMS(
"communes", "http://172.31.172.244:8080/geoserver/wms",
{
layers: 'bl:communes',
syle:'',
SLD: 'http://172.31.172.244/myStyle.xml’
},
{buffer: 0}
if i call the same page from the server machine, replacing 172.31.172.244 by
localhost, it keeps not working...
any one have an idea ? seems that my version of geoserver on my remote server (1.7.1) doesn't work
fine or maybe i have to change a parameter in the config ?
If it works on yours but not on the server, it may be a case of
the server not being able to reach its own public IP?
It happens for example with my home connection, other people can
reach me thru my public IP, but I cannot connect to it from
within my local network (the ISP is blocking such access).
If that's the case, have you tried changing the SLD param
on your server to
SLD: 'http://localhost/myStyle.xml’
or
SLD: 'http://127.0.0.1/myStyle.xml’
and oh, this seems to assume you have Apache running as well
(no 8080 port on the sld address).
I've also tried have one of our servers on Linux render
topp:states with a style coming from a remote server
(style attached) and it worked fine. The request looked
like:
http://sigma.openplans.org:8080/geoserver/wms?WIDTH=800&SRS=EPSG%3A4326&LAYERS=topp%3Astates&HEIGHT=400&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-137.18031789177215,17.31338778227679,-55.742520075472584,58.03228669042659&SLD=http://host:port/path/to/polygonstates.sld
(just fix the location of the sld, the rest is pointing
to a real 1.7.1 instance).
I'm also wondering what kind of &sld behaviour you are
looking for. There are three:
- you specify the sld, and not specify either layer nor
styles. In this case the sld is assumed to contain
a full definition of layers and styles, each NamedLayer
is processed in order, the name of the layer is the
name of one featureType/coverage in GeoServer, the
UserStyle its style
- you specify the sld and the layer names. This is
library mode, the sld must contain a UserLayer whose
name matches the specified layer, its style will
be used (and so on for each layer you specified
- you specify the sld, layers and styles. In this
case it works as above, but once it located the
NamedLayer corresponding to the current layer, it
chooses the UserStyle whose name matches the
style specified in &styles (as you can have many
of them inside each NamedLayer)
This should not really affect your case thought, the
above behaviour has been around for a full year already
(so 1.7.0 should behave the same way).
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
polygonstates.sld (1.09 KB)