[OpenLayers-Users] Trouble after upgrading to Geoserver 2.0

totom tommaso.lavoro at gmail.com
Thu Nov 5 07:21:32 EST 2009


I have 2 namespaces in geoserver, urbis_2 and urbis_dev

With urbis_2 ns and prefix, openlayers parses the gml and i see the features
on the map.
If i use urbis_dev, geoserver replies with a (correct?) xml, but openlayers
does not parse it.

This is the js code 

poly  = new OpenLayers.Layer.Vector
		( 
			'Pippo', 
			{
            	strategies: [fixedStrategy,saveStrategy ],	
            	projection: new OpenLayers.Projection("EPSG:4326"),
		styleMap: stylemm,
            	protocol: new OpenLayers.Protocol.WFS.v1_1_0(
				{
                    version: '1.1.0',
                    srsName: 'EPSG:4326',
                    url: 'http://$151.100.152.220/geoserver2/wfs',
					featureType: 'pippo',
                    featureNS :  'http://151.100.152.220/urbis_dev/',
					featurePrefix: 'urbis_dev',
				    geometryName: 'the_geom', 
					extractAttribute:   true
				}
				),
				getFeatureByFid: function(fid)
				{
					var layer = this;
					if (!layer) return null;
					var features = layer.features;
					if (!features)return null;
					for (var i = 0; i < features.length; ++i) 
						if (features[i].fid == fid) return features[i];
					return null;
				}
			}
		);

This is se response after requesting features in urbis_dev....where is the
problem?

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection 
        numberOfFeatures="2" 
        timeStamp="2009-11-05T11:16:35.348+01:00" 
        xsi:schemaLocation="http://151.100.152.220/urbis_dev
http://151.100.152.220:8090/geoserver/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=urbis_dev%3Adata_crash_feature
http://www.opengis.net/wfs
http://151.100.152.220:8090/geoserver/schemas/wfs/1.1.0/wfs.xsd" 
        xmlns:ogc="http://www.opengis.net/ogc" 
        xmlns:urbis_2="http://151.100.152.220/urbis_2/" 
        xmlns:tiger="http://www.census.gov" 
        xmlns:urbis_dev="http://151.100.152.220/urbis_dev" 
        xmlns:wfs="http://www.opengis.net/wfs" 
        xmlns:topp="http://www.openplans.org/topp" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:sf="http://www.openplans.org/spearfish" 
        xmlns:ows="http://www.opengis.net/ows" 
        xmlns:gml="http://www.opengis.net/gml" 
        xmlns:xlink="http://www.w3.org/1999/xlink">
  <gml:featureMembers>
    <urbis_dev:data_crash_feature gml:id="data_crash_feature.55">
      <gml:description>rosso</gml:description>
      <urbis_dev:_status>1</urbis_dev:_status>
      <urbis_dev:_type>1</urbis_dev:_type>
      <urbis_dev:_hide>n</urbis_dev:_hide>
      <urbis_dev:_fid>589</urbis_dev:_fid>
      <urbis_dev:_author>pippo</urbis_dev:_author>
      <urbis_dev:_ctime>1252857959</urbis_dev:_ctime>
      <urbis_dev:description>rosso</urbis_dev:description>
      <urbis_dev:datetime>1252857959</urbis_dev:datetime>
      <urbis_dev:injuried>1</urbis_dev:injuried>
      <urbis_dev:dead>0</urbis_dev:dead>
      <urbis_dev:veic>0</urbis_dev:veic>
      <urbis_dev:the_geom>
        <gml:MultiPoint
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
          <gml:pointMember>
            <gml:Point>
              <gml:pos>12.467980384826 41.919139792195</gml:pos>
            </gml:Point>
          </gml:pointMember>
        </gml:MultiPoint>
      </urbis_dev:the_geom>
    </urbis_dev:data_crash_feature>
    <urbis_dev:data_crash_feature gml:id="data_crash_feature.61">
      <gml:description>bbbbbb658546</gml:description>
      <urbis_dev:_status>1</urbis_dev:_status>
      <urbis_dev:_type>1</urbis_dev:_type>
      <urbis_dev:_hide>n</urbis_dev:_hide>
      <urbis_dev:_fid>680</urbis_dev:_fid>
      <urbis_dev:_author>tommaso</urbis_dev:_author>
      <urbis_dev:_ctime>1253631099</urbis_dev:_ctime>
      <urbis_dev:description>bbbbbb658546</urbis_dev:description>
      <urbis_dev:datetime>1254063099</urbis_dev:datetime>
      <urbis_dev:injuried>5</urbis_dev:injuried>
      <urbis_dev:dead>10</urbis_dev:dead>
      <urbis_dev:veic>55</urbis_dev:veic>
      <urbis_dev:the_geom>
        <gml:MultiPoint
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
          <gml:pointMember>
            <gml:Point>
              <gml:pos>12.4915369 41.9045518</gml:pos>
            </gml:Point>
          </gml:pointMember>
        </gml:MultiPoint>
      </urbis_dev:the_geom>
    </urbis_dev:data_crash_feature>
  </gml:featureMembers>
</wfs:FeatureCollection>

-- 
View this message in context: http://n2.nabble.com/Trouble-after-upgrading-to-Geoserver-2-0-tp3937791p3951780.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list