4

1) I publish 4 layers in Geoserver (planet_osm_line, planet_osm_point, planet_osm_polygon, planet_osm_roads).

2) Then I add styles (from sld styles) to the Geoserver.

3) Then I set this styles in my layers.

4) Now I want to see this 4 layers in browser. But i can't. Please, help me.

Also do I need to create workspace before this 4 steps?

  • 1
    As per my knowledge You can not view all layers at a time in browser(in geoserver). You need to call the WMS link in Open layer/Leaflet then with the help of check box you can do that example :geo.dianacht.de/tests/extlayer2.html – Sunil Sep 4 '13 at 6:45
  • It is very sad. In ArcGis Server I can see many layers in one map. So I need only one link to this global WMS layer. – novicegis Sep 4 '13 at 6:53
  • I need one map from many layers because: 1) I need Cache this data. 2) I need display map from GeoServer in ArcMap. (So the render is GeoServer. But we look at the map in ArcMap.) – novicegis Sep 4 '13 at 6:57
  • 2
    @Sunil: It is very much possible to see multiple layers at once by using Layer Groups. – Devdatta Tengshe Sep 4 '13 at 8:12
  • @DevdattaTengshe thanks for the information.I didn't tried that.. thanks for update : ) – Sunil Sep 4 '13 at 8:33
12

You can do this by using Layer Groups.

In the Admin interface, Under the 'Data' section on the left click on 'Layer Groups'. Then, in the usual GeoServer way, create a new layer group (by default you may already have a couple of examples) and then follow the intuitive interface to add layers to the group. Once you have your Layer Group created, go back to Layer Perview and you will find it in there. The symbol will be a set of green layers (as opposed to the little blue icons used for single point, line, polygon and raster layers). You can now view a group of layers.

6

The other way is to list all the layers you want in the LAYERS parameter of your WMS request.

If you have GeoServer installed locally you can try

http://localhost:8080/geoserver/wms?LAYERS=topp:states,tiger:poi&STYLES=&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-74.028479182883,40.704071325538,-73.985512314539,40.72224961599&WIDTH=780&HEIGHT=330

which should show you something like:enter image description here

  • 1
    One positive aspect of this approach over layer groups is that it allows you to specify styles and CQL filters for each layer in the URL. – hcarty Dec 17 '14 at 18:45
  • 2
    Great point. And if anyone is having trouble with cql_filter, make sure there is one (or maybe some kind of placeholder if you don't want a filter) for each layer in the request, and that they are delimited by a semicolon. docs.geoserver.org/latest/en/user/services/wms/… – abettermap Nov 17 '15 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.