So my question is if it is a correct way to get geometry data from shapefile layer in the geoserver.<br><br>
<div class="gmail_quote">On Wed, Jul 27, 2011 at 9:58 AM, Danjun <span dir="ltr">&lt;<a href="mailto:byeautumn@gmail.com">byeautumn@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi, all<br><br>I have been stuck for several days about this problem.<br><br>1. I added a shapefile layer in the geoserver and want to render geometry<br>
data by openlayers from this layer in the geoserver.<br><br>2. My code is like this way:<br>               MobileTiled = new OpenLayers.Layer.WMS(<br>                   &quot;Brandband:Other_Project - Tiled&quot;,<br>&quot;<a href="http://127.0.0.1:8081/geoserver/Brandband/wms" target="_blank">http://127.0.0.1:8081/geoserver/Brandband/wms</a>&quot;,<br>
                   {<br>                       LAYERS: &#39;Brandband:Mobile_project&#39;,<br>                       STYLES: &#39;&#39;,<br>                       format: format,<br>                       tiled: !pureCoverage,<br>
                       tilesOrigin : map.maxExtent.left + &#39;,&#39; +<br>map.maxExtent.bottom<br>                   },<br>                   {<br>                       buffer: 0,<br>                       displayOutsideMaxExtent: true,<br>
                       isBaseLayer: true<br>                   }<br>               );<br><br>               var saveStrategy = new OpenLayers.Strategy.Save();<br>                               wfslayer = new OpenLayers.Layer.Vector(&quot;WFS&quot;, {<br>
                                       strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],<br>                                       projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>                                       protocol: new OpenLayers.Protocol.WFS({<br>
                                                       url:  &quot;<a href="http://localhost:8081/geoserver/wfs" target="_blank">http://localhost:8081/geoserver/wfs</a>&quot;,<br>                                                       version: &quot;1.1.0&quot;,<br>
                                                       srsName: &quot;EPSG:4326&quot;,<br>                                                       featureNS :  &quot;Brandband&quot;,<br>                                                       featureType: &quot;Mobile_project&quot;,<br>
                                                       schema:<br>&quot;<a href="http://localhost:8081/geoserver/wfs/DescribeFeatureType?version=1.1.0&amp;typename=Brandband:Mobile_project" target="_blank">http://localhost:8081/geoserver/wfs/DescribeFeatureType?version=1.1.0&amp;typename=Brandband:Mobile_project</a>&quot;<br>
                                                         }),<br>                                       reportError: true,<br>                                       renderers: [&#39;Canvas&#39;, &#39;SVG&#39;, &#39;VML&#39;]<br>
                               });<br><br>                               map.addLayers([MobileTiled, wfslayer]);<br><br>3. I also added ModifyFeature control, but can&#39;t see any features in the<br>wfslayer.<br>4. When I set url as<br>
&quot;<a href="http://127.0.0.1:8081/geoserver/Brandband/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=Brandband:Mobile_project&amp;maxFeatures=50" target="_blank">http://127.0.0.1:8081/geoserver/Brandband/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=Brandband:Mobile_project&amp;maxFeatures=50</a>&quot;,<br>
I can see<br><br>&lt;wfs:FeatureCollection xmlns=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>&quot;<br>xmlns:wfs=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>&quot;<br>
xmlns:Brandband=&quot;<a href="http://www.mbakercorp.com/Brandband" target="_blank">www.mbakercorp.com/Brandband</a>&quot;<br>xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot;<br>
xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>xsi:schemaLocation=&quot;<a href="http://www.mbakercorp.com/Brandband" target="_blank">www.mbakercorp.com/Brandband</a><br>
<a href="http://127.0.0.1:8081/geoserver/Brandband/wfs?service=WFS&amp;version=1.0.0&amp;request=DescribeFeatureType&amp;typeName=Brandband%3AMobile_project" target="_blank">http://127.0.0.1:8081/geoserver/Brandband/wfs?service=WFS&amp;version=1.0.0&amp;request=DescribeFeatureType&amp;typeName=Brandband%3AMobile_project</a><br>
<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a><br><a href="http://127.0.0.1:8081/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd" target="_blank">http://127.0.0.1:8081/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd</a>&quot;&gt;<br>
&lt;gml:boundedBy&gt;<br>&lt;gml:null&gt;unknown&lt;/gml:null&gt;<br>&lt;/gml:boundedBy&gt;<br>&lt;gml:featureMember&gt;<br>&lt;Brandband:Mobile_project fid=&quot;Mobile_project.1&quot;&gt;<br>&lt;Brandband:the_geom&gt;<br>
&lt;gml:MultiPolygon srsName=&quot;<a href="http://www.opengis.net/gml/srs/epsg.xml#3857" target="_blank">http://www.opengis.net/gml/srs/epsg.xml#3857</a>&quot;&gt;<br>&lt;gml:polygonMember&gt;<br>&lt;gml:Polygon&gt;<br>&lt;gml:outerBoundaryIs&gt;<br>
&lt;gml:LinearRing&gt;<br>&lt;gml:coordinates xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot; decimal=&quot;.&quot; cs=&quot;,&quot;<br>ts=&quot; &quot;&gt;<br>-8729827.6436,4052279.3156 -8730097.9274,4052279.3156<br>
-8730165.4983,4052360.9895 -8730165.4983,4052687.8254<br>-8730165.4983,4053014.5362 -8730097.9274,4053096.2154<br>-8729895.2146,4053341.2564 -8729827.6436,4053422.938<br>-8729557.2486,4053422.938 -8729286.9649,4053422.938<br>
-8729219.3939,4053341.2564 -8729016.6811,4053096.2154<br>-8728949.1102,4053014.5362 -8728949.1102,4052687.8254<br>-8728949.1101,4052360.9895 -8729016.6811,4052279.3156<br>-<a href="tel:8729286.965%2C4052279" value="+18729286965">8729286.965,4052279</a>.3156 -8729557.2486,4052279.3156<br>
-8729827.6436,4052279.3156<br>&lt;/gml:coordinates&gt;<br>&lt;/gml:LinearRing&gt;<br>&lt;/gml:outerBoundaryIs&gt;<br>&lt;/gml:Polygon&gt;<br>&lt;/gml:polygonMember&gt;<br>&lt;gml:polygonMember&gt;<br>&lt;gml:Polygon&gt;<br>
&lt;gml:outerBoundaryIs&gt;<br>&lt;gml:LinearRing&gt;<br>&lt;gml:coordinates xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot; decimal=&quot;.&quot; cs=&quot;,&quot;<br>
ts=&quot; &quot;&gt;<br>-8438634.7308,4187198.1974 -8439174.5259,4186981.0872<br>-8439056.6102,4187125.1524 -8438994.7818,4187230.2986<br>-8438634.7308,4187198.1974<br>&lt;/gml:coordinates&gt;<br>&lt;/gml:LinearRing&gt;<br>
&lt;/gml:outerBoundaryIs&gt;<br>&lt;/gml:Polygon&gt;<br>&lt;/gml:polygonMember&gt;<br>&lt;gml:polygonMember&gt;<br>&lt;gml:Polygon&gt;<br>&lt;gml:outerBoundaryIs&gt;<br>&lt;gml:LinearRing&gt;<br>&lt;gml:coordinates xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot; decimal=&quot;.&quot; cs=&quot;,&quot;<br>
ts=&quot; &quot;&gt;<br>-8437907.1028,4187545.9477 -8438330.0637,4187341.1429<br>-8438245.0203,4187455.0579 <a href="tel:-8438185.716%2C4187560" value="+18438185716">-8438185.716,4187560</a>.1419<br>-8437907.1028,4187545.9477<br>
&lt;/gml:coordinates&gt;<br>&lt;/gml:LinearRing&gt;<br>&lt;/gml:outerBoundaryIs&gt;<br>&lt;/gml:Polygon&gt;<br>&lt;/gml:polygonMember&gt;<br>&lt;gml:polygonMember&gt;<br>&lt;gml:Polygon&gt;<br>&lt;gml:outerBoundaryIs&gt;<br>
&lt;gml:LinearRing&gt;<br>&lt;gml:coordinates xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot; decimal=&quot;.&quot; cs=&quot;,&quot;<br>ts=&quot; &quot;&gt;<br>-8437382.9111,4187827.2485 -8437721.4226,4187555.5367<br>
-8437907.1028,4187545.9477 -8437715.7003,4187803.7501<br>-8437593.3591,4187864.2463 -8437382.9111,4187827.2485<br>&lt;/gml:coordinates&gt;<br>&lt;/gml:LinearRing&gt;<br>&lt;/gml:outerBoundaryIs&gt;<br>&lt;/gml:Polygon&gt;<br>
&lt;/gml:polygonMember&gt;<br>&lt;gml:polygonMember&gt;<br>&lt;gml:Polygon&gt;<br>&lt;gml:outerBoundaryIs&gt;<br>&lt;gml:LinearRing&gt;<br>&lt;gml:coordinates xmlns:gml=&quot;<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>&quot; decimal=&quot;.&quot; cs=&quot;,&quot;<br>
ts=&quot; &quot;&gt;<br>-8414918.1607,4200093.3668 -8415149.6773,4200113.3069<br>-8415252.7036,4200251.1763 -8415265.4443,4200524.8842<br>-8414987.1193,4200439.4299 -8414918.1607,4200093.3668<br>&lt;/gml:coordinates&gt;<br>
&lt;/gml:LinearRing&gt;<br>&lt;/gml:outerBoundaryIs&gt;<br>&lt;/gml:Polygon&gt;<br>&lt;/gml:polygonMember&gt;<br>....<br><font color="#888888"><br>--<br>View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/render-geometry-data-from-geoserver-tp6626253p6626253.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/render-geometry-data-from-geoserver-tp6626253p6626253.html</a><br>
Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</font></blockquote></div><br>