Thanks. I still get in FireBug:<br><br><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch opened"><div class="errorTitle">OpenLayers.Protocol.WFS is not a constructor</div><div class="errorTrace"><div class="objectBox objectBox-stackFrame">
<a class="objectLink">init</a>()<span class="objectLink-sourceLink objectLink">openlayers3.html (line 83)</span></div><div class="objectBox objectBox-stackFrame"><a class="objectLink">onload</a>(<a class="objectLink objectLink-object">load </a><span class="arrayComma"></span>)<span class="objectLink-sourceLink objectLink">7tnQksP2...GPg%3D%3D (line 2)</span></div>
</div><div class="errorSourceBox errorSource-exec"><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak"><span class="errorSource"> featureNS: "kulturminner_ns", })</span></div>
</span><br><br>In the demo page og GeoServer I see the layer as "<b><a href="http://naturkart.no:8080/geoserver/wms?bbox=582633.35,6523100.745,673298.65,6636394.255&styles=&Format=application/openlayers&request=GetMap&version=1.1.1&layers=kulturminner_ns:gravminne&width=490&height=550&srs=EPSG:32632" target="_blank">kulturminner_ns:gravminne</a>"</b> so am I writing this correctly?<br>
<br> map.addLayer(new OpenLayers.Layer.Vector("Gravminne", {<br> strategies: [new OpenLayers.Strategy.BBOX()],<br> projection: new OpenLayers.Projection("EPSG:4326"),<br> protocol: new OpenLayers.Protocol.WFS({<br>
srsName: "EPSG:4326",<br> url: "<a href="http://naturkart.no:8080/geoserver/wfs&request=getmap">http://naturkart.no:8080/geoserver/wfs&request=getmap</a>",<br> featureType: "gravminne",<br>
featureNS: "kulturminner_ns", })<br> }<br> ));<br><br><br><div class="gmail_quote">2009/3/29 Ingo Weinzierl <span dir="ltr"><<a href="mailto:ingo.weinzierl@intevation.de">ingo.weinzierl@intevation.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div>Hello Asle,</div><div><br></div><div>I don't know if this could solve your problem, but I am using a vector layer as well.</div>
<div>Defining the WFS protocol looks a bit different from yours:</div><div><br></div><div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> wfs = </span></font><span style="color: rgb(166, 23, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">new</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;"> OpenLayers.Layer.Vector(</span></font></div>
<div style="margin: 0px; color: rgb(128, 18, 179);"><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;"> </span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">"Name of the Layer"</span></font><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">,</span></font></span></div>
<div class="im"><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> {</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> strategies: [</span></font><span style="color: rgb(166, 23, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">new</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;"> OpenLayers.Strategy.BBOX()],</span></font></div>
</div><div class="im"><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> projection: </span></font><span style="color: rgb(166, 23, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">new</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;"> OpenLayers.Projection(</span></font><span style="color: rgb(128, 18, 179);"><font face="Helvetica" size="3"><span style="font-size: 12px;">"EPSG:4326"</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">),</span></font></div>
</div><div class="im"><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> protocol: </span></font><span style="color: rgb(166, 23, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">new</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;"> OpenLayers.Protocol.WFS({</span></font></div>
</div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> srsName: </span></font><span style="color: rgb(128, 18, 179);"><font face="Helvetica" size="3"><span style="font-size: 12px;">"EPSG:4326"</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">,</span></font></div>
<div style="margin: 0px; color: rgb(128, 18, 179);"><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;"> url: </span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">"<a href="http://localhost:8080/geoserver/wfs" target="_blank">http://localhost:8080/geoserver/wfs</a>"</span></font><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">,</span></font></span></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> featureType: </span></font><span style="color: rgb(128, 18, 179);"><font face="Helvetica" size="3"><span style="font-size: 12px;">"rohre_graben_damm"</span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">,</span></font></div>
<div style="margin: 0px; color: rgb(128, 18, 179);"><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;"> featureNS: </span></font></span><font face="Helvetica" size="3"><span style="font-size: 12px;">"<a href="http://www.openplans.org/topp" target="_blank">http://www.openplans.org/topp</a>"</span></font><span style="color: rgb(0, 0, 0);"><font face="Helvetica" size="3"><span style="font-size: 12px;">,</span></font></span></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> })</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> }</span></font></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"> );</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"><br></span></font></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">I hope this can help you.</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"><br>
</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">Regards,</span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">Ingo</span></font></div>
</div><br><div><div>Am 29.03.2009 um 03:28 schrieb Asle Benoni:</div><br><blockquote type="cite"><div><div></div><div class="h5">I changed the URL but still get this response:<br><br><span><b>OpenLayers.Protocol.WFS is not a constructor<br>
</b><br> map.addLayer(new OpenLayers.Layer.Vector("Gravminne", {<br> strategies: [new OpenLayers.Strategy.BBOX()],<br> protocol: new OpenLayers.Protocol.WFS({<br> url: "<a href="http://naturkart.no:8080/geoserver/wfs&request=getmap" target="_blank">http://naturkart.no:8080/geoserver/wfs&request=getmap</a>",<br>
typeName: "gravminne",<br> featurePrefix: "kulturminner_ns"<br> })<br> }));<br><br>/asle<br><br></span><div class="gmail_quote">2009/3/28 Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">add &request=getmap to your url.<br> <br> Regards,<br> andreas.<br> <div><div></div><div>
<br> On 3/28/09, Asle Benoni <<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>> wrote:<br> > Hello,<br> > I tried the new WFS code but I still get this response:<br> ><br> > <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE<br>
> ServiceExceptionReport SYSTEM "http:<br> > //<a href="http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd" target="_blank">schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd</a>"><br> > <ServiceExceptionReport version="1.1.1" ><br>
> <ServiceException code="MissingParameterValue" locator="request"><br> > Could not determine geoserver request from http request<br> > org.apache.catalina.connector.RequestFacade<br>
> @10f829<br> > </ServiceException></ServiceExceptionReport><br> ><br> ><br> > I wonder if this WFS call can give me what I want with a KML response. I<br> > want to be able to click on the location and a popup with a style for the<br>
> popup, show a picture, a link etc. fetched from the PostgreSQL table.<br> ><br> > /asle<br> ><br> > 2009/3/27 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>><br>
><br> >> Hi,<br> >><br> >> On Thu, Mar 26, 2009 at 5:08 PM, Asle Benoni <<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>><br> >> wrote:<br> >> > I am really frustrated about not beeing able to display a kmz layer in<br>
>> > OpenLayers.<br> >> > Here is the code:<br> >> ><br> >> > map.addLayer(new OpenLayers.Layer.GML("Gravminne", "<br> >> <a href="http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kml+XML&transparent=true&srs=EPSG:4326&transparent=true&" target="_blank">http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kml+XML&transparent=true&srs=EPSG:4326&transparent=true&</a><br>
>> > ",<br> >> > {<br> >> > format: OpenLayers.Format.KML,<br> >> > formatOptions: {<br> >> > extractStyles: true,<br>
>> > extractAttributes: true,<br> >> > transparent:true<br> >> > }<br> >> > }));<br> >><br> >> The geoserver url you are using here will always return KMZ, which<br>
>> OpenLayers cannot parse. Instead, you should use the following to<br> >> create your layer:<br> >><br> >> map.addLayer(new OpenLayers.Layer.WFS("Gravminne",<br> >> "<br> >> <a href="http://naturkart.no:8080/geoserver/wms?service=WMS&request=GetMap&layers=kulturminner_ns:gravminne&format=kml&srs=EPSG:4326" target="_blank">http://naturkart.no:8080/geoserver/wms?service=WMS&request=GetMap&layers=kulturminner_ns:gravminne&format=kml&srs=EPSG:4326</a><br>
>> ",<br> >> {<br> >> format: OpenLayers.Format.KML,<br> >> formatOptions: {<br> >> extractStyles: true,<br> >> extractAttributes: true<br>
>> }<br> >> }));<br> >><br> >> Is there a specific reason why you want to use KML? WFS would give<br> >> you the same result, you would only have to use a style map for your<br>
>> symbology in addition. This is how to add the layer using the new WFS<br> >> protocol:<br> >><br> >> map.addLayer(new OpenLayers.Layer.Vector("Gravminne", {<br> >> strategies: [new OpenLayers.Strategy.BBOX()],<br>
>> protocol: new OpenLayers.Protocol.WFS({<br> >> url: "<a href="http://naturkart.no:8080/geoserver/wfs" target="_blank">http://naturkart.no:8080/geoserver/wfs</a>",<br> >> typeName: "gravminne",<br>
>> featurePrefix: "kulturminner_ns"<br> >> })<br> >> ));<br> >><br> >> For the symbology, you can use OpenLayers.Format.SLD to use a sld file<br> >> that you already have on your server. Look at examples/SLD.html to see<br>
>> how to configure this.<br> >><br> >> And you need OpenLayers.ProxyHost configured with a working proxy url.<br> >><br> >> If a map image rendered on the server would also do, you could just<br>
>> use a WMS layer, and don't even need a ProxyHost:<br> >><br> >> map.addLayer(new OpenLayers.Layer.WMS("Gravminne";<br> >> "<a href="http://naturkart.no:8080/geoserver/wms" target="_blank">http://naturkart.no:8080/geoserver/wms</a>?", {<br>
>> transparent: true,<br> >> layers: "kulturminner_ns:gravminne"<br> >> }));<br> >> }<br> >><br> >> > I can see the http request from the proxy so it is fetching correct<br>
>> > data (I think) but I cannot see any on the map!<br> >> > The request looks like this (FireBug). I am not sure if the EPSG is<br> >> > correct. I also tried "EPSG:32632" which I set for the map.<br>
>><br> >> With the WFS setup above (first of my code snippets), the data should<br> >> be automatically reprojected to the SRS of your map.<br> >><br> >> > Can anyone point to how to show a KMZ file from GeoServer as I need<br>
>> > the options for that layer format. I checked the docs but did not get<br> >> > wiser.<br> >><br> >> As already said, OpenLayers can not parse KMZ, only KML. To make<br> >> GeoServer output KML, your request would have to be a WMS request and<br>
>> look like this:<br> >><br> >><br> >> <a href="http://naturkart.no:8080/geoserver/wms/?service=wms&request=GetMap&layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kml+XML&format=kml&bbox=0,0,180,90&width=500&height=250&srs=EPSG:4326" target="_blank">http://naturkart.no:8080/geoserver/wms/?service=wms&request=GetMap&layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kml+XML&format=kml&bbox=0,0,180,90&width=500&height=250&srs=EPSG:4326</a><br>
>><br> >> This is what will get generated with the second of my code snippets above.<br> >><br> >> Regards,<br> >> Andreas.<br> >><br> >> --<br> >> Andreas Hocevar<br> >> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
>> Expert service straight from the developers.<br> >><br> ><br> <br> </div></div><font color="#888888">--<br> Sent from my mobile device<br> </font><div><div></div><div><br> Andreas Hocevar<br> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br> </div></div></blockquote></div><br></div></div> _______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br></div></blockquote></div><br>