<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Olá bom dia,<br><br>Também estou a iniciar-me no Geoserver (há cerca de uma semana) e tenho este mesmo problema do Oscar. <br><br>Fazendo a edição com o uDig via WFS-T, tudo corre bem, consigo ver o resultado da edição, tanto na base de dados, como no QGIS, mal faço "Commit changes" no uDig. <br><br>No entanto, utilizando o exemplo wfs-t.html, mesmo com as alterações da bbox que resolveram o problema ao Oscar, não consigo visualizar o WFS. Aliás, com os as alterações do Oscar, nem aparecem os WMS, nem sequer os controlos do OpenLayers. <br><br>Deixo aqui o código que estou a testar:<br><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br> <head><br> <link rel="stylesheet"
href="http://localhost:8080/geoserver/style.css" type="text/css" /><br> <style type="text/css"><br> body {<br> margin: 1em;<br> }<br> #map {<br> width: 800px;<br> height: 475px;<br> border: 1px solid black;<br> }<br> </style><br><br> <script src="http://openlayers.org/api/OpenLayers.js"></script><br> <script type="text/javascript"><br><br> OpenLayers.IMAGE_RELOAD_ATTEMPTS =
3;<br> var map;<br><br> function init(){<br> <br> var bounds = new OpenLayers.Bounds(<br> 71085.954, 100001.161,<br> 102603.730, 145416.122<br> );<br><br> var options = {<br> controls:
[],<br> maxExtent: bounds,<br> maxResolution: 87.17609375,<br> projection: "EPSG:3763",<br> units: 'm'<br> };<br> <br> map = new OpenLayers.Map('map',
options);<br> <br> var vias = new OpenLayers.Layer.WMS(<br> "Rede Viaria",<br> "http://localhost:8080/geoserver/wms",<br> {layers: 'pinhel:rede_viaria',<br> projection: new OpenLayers.Projection("EPSG:3763"),<br> displayProjection: new
OpenLayers.Projection("EPSG:3763"),<br> format: 'image/png'}<br> );<br> <br> <br><br> <br> pedreiras.style = OpenLayers.Util.applyDefaults({strokeColor: "#ff0000"},<br> OpenLayers.Feature.Vector.style["default"]);<br><br> var ocorrencias = new
OpenLayers.Layer.WFS(<br> "Ocorrências",<br> "http://localhost:8080/geoserver/wfs",<br> {typename: 'pinhel:ocorrencias'},<br> {<br> typename: 'ocorrencias',<br> featureNS: 'http://localhost:8080/pinhel',<br> extractAttributes:
false,<br> srsName: 'EPSG:3763',<br> geometryName: 'the_geom'<br> }<br> );<br> ocorrencias.style = OpenLayers.Util.applyDefaults({strokeColor: "#0000ff"},<br> OpenLayers.Feature.Vector.style["default"]);<br> <br><br>
map.addLayers([vias, ocorrencias]);<br><br><br> var panel = new OpenLayers.Control.Panel(<br> {displayClass: 'olControlEditingToolbar'}<br> );<br> <br> var drawLine = new OpenLayers.Control.DrawFeature(<br> eixos_via, OpenLayers.Handler.Path,<br> {displayClass: 'olControlDrawFeaturePath'}<br> );<br>
drawLine.featureAdded = function(feature) {<br> feature.layer.eraseFeatures([feature]);<br> // cast to multilinestring<br> feature.geometry = new OpenLayers.Geometry.MultiLineString(<br> feature.geometry<br> );<br> feature.style.strokeColor = "#ff0000";<br> feature.state =
OpenLayers.State.INSERT;<br> feature.layer.drawFeature(feature);<br> }<br><br> var drawPoint = new OpenLayers.Control.DrawFeature(<br> pontos_interesse, OpenLayers.Handler.Point,<br> {displayClass: 'olControlDrawFeaturePoint'}<br> );<br> drawPoint.featureAdded = function(feature) {<br>
feature.layer.eraseFeatures([feature]);<br> feature.style.strokeColor = "#0000ff";<br> feature.state = OpenLayers.State.INSERT;<br> feature.layer.drawFeature(feature);<br> }<br> <br> panel.addControls(<br> [new OpenLayers.Control.Navigation(), drawLine, drawPoint]<br>
);<br> <br> map.addControl(panel);<br> map.addControl(new OpenLayers.Control.LayerSwitcher());<br> map.addControl(new OpenLayers.Control.ScaleLine());<br> map.addControl(new OpenLayers.Control.PanZoomBar());<br> map.addControl(new OpenLayers.Control.MousePosition());<br> <br>
map.zoomToExtent(bounds);<br> <br> }<br> </script><br> </head><br> <body onload="init()"><br> <h3>OpenLayers WFS-T demo: Tasmania cities and roads</h3><br> <a href="#" onclick="map.layers[2].commit();return false">Save Roads</a><br /><br> <a href="#" onclick="map.layers[3].commit();return false">Save Cities</a><br> <div id="map"></div><br> </body><br></html><br><br>Abraço!<br>Pedro Venâncio<br></td></tr></table><br>