Prompting suggestions I’m going to attempt to reword my question
I have a PostGis table that contains overlapping vector polygons. I need to display a selection in Geoserver and provide functionality for the user to toggle on & off unwanted polygons.
I need to add multiple layers from a PostGis Table.
I’ve made a start with the code below but I’m stuck with the following:
Why are all the layers Base Layers? Land should be the only base layer the rest overlays?
Can all overlay layers be on at once?
How do I move the layerswitcher control outside the map area? When I click inside the map how do I show the attribution?
How do I create a new layer by script either with a polygon given a
co-ordinate string, or a point and radius?How do I create a list of all the selected layers?
body { margin: 1em; } #map { width: 800px; height: 475px; border: 1px solid black; } OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
var map; function init(){ map = new OpenLayers.Map('map'); var Base = new OpenLayers.Layer.WMS( "Land", "http://localhost:8080/geoserver/cite/wms", {LAYERS: 'cite:land', format: 'image/png', isBaseLayer: true } ); var L10299 = new OpenLayers.Layer.WMS( "10299", "http://localhost:8080/geoserver/cite/wms", { VIEWPARAMS: 'kathy:10299', LAYERS: 'cite:Q_Results', isBaseLayer: false } ); var L43352 = new OpenLayers.Layer.WMS( "43352", "http://localhost:8080/geoserver/cite/wms", { VIEWPARAMS: 'kathy:43352', LAYERS: 'cite:Q_Results', isBaseLayer: false } ); var L25177 = new OpenLayers.Layer.WMS( "25177", "http://localhost:8080/geoserver/cite/wms", { VIEWPARAMS: 'kathy:25177', LAYERS: 'cite:Q_Results', isBaseLayer: false } ); map.addLayers([Base, L10299, L43352, L25177]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.zoomToExtent( new OpenLayers.Bounds(12.996, 52.172,13.931, 52.958) ); } </script>
OpenLayers PostGis Layers