[OpenLayers-Users] WFS, what EPSG use???

Arturo Juárez Lima ajuarez at queretaro.gob.mx
Thu Oct 29 12:46:47 EDT 2009


Thanks

I again change the code, and this form, in firebug send me coord to the
lines, whit out errors, but in the map don't show me the shape.
I was change geometryName of 'the_geom' by 'SHAPE', because with
'the_geom' the firebug send me error.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Prueba 1a</title>
</head>
 <script src="http://www.openlayers.org/dev/OpenLayers.js"
type="text/javascript">
        </script>


<body BGCOLOR=#CCCC98 onload="load();">

<div id="map" style="width: 800px; height: 500px; top:-3px; left:-350px;
border: 9px solid #EBE9D4;"></div>

<script type="text/javascript">
function load() {
	format = 'image/png';
	var options = {
	
                controls:[
			new OpenLayers.Control.Navigation(),
			new OpenLayers.Control.PanZoomBar(),
			new OpenLayers.Control.LayerSwitcher({'ascending':false}),
			new OpenLayers.Control.ScaleLine(),
			new OpenLayers.Control.MousePosition(),
			new OpenLayers.Control.KeyboardDefaults() ],
		numZoomLevels: 31,units: 'm' };
	var map = new OpenLayers.Map("map", options);

	l1 = new OpenLayers.Layer.WMS(
                    'Limites', "http://172.16.23.21:8080/geoserver/wms",
                    {layers: 'sde:SPF_CATASTRO.LMA',
                        srs: 'EPSG:900913',
			transparent: true,
                        format: format,
                        tiled: 'true'
                    },{singleTile: true, isBaseLayer: true});
	l1.setVisibility(true); 
        map.addLayer(l1);

	var layer = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url:  "http://172.16.23.21:8080/geoserver/wfs",
            featureType: "DTYT.SSC_RUTAS_2009",
            featureNS: "http://172.16.23.21:8080/sde",
	    geometryName: 'SHAPE',
            version: "1.1.0",
            srsName: "EPSG:4326"
        })   });

/*	var layer2 = new OpenLayers.Layer.WFS( 
                'schools', "http://172.16.23.21:8080/geoserver/wfs",
                {typename: 'TYT:rutas_2009',maxfeatures: 10}, 
                { featureClass: OpenLayers.Feature.WFS}); */
            map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(-99.854736328125,20.80875529543977),
9); 

}
</script>

</body>
</html>
-- 
Arturo Juárez Lima <ajuarez at queretaro.gob.mx>
GEQ


El jue, 29-10-2009 a las 17:35 +0100, Andreas Hocevar escribió:

> Arturo Juárez Lima wrote:
> > Thanks Andreas,
> >
> > I was change the code with your suggestion, and change the url for the 
> > ip, only my local examples.
> 
> But you made one fatal modification of my suggestion:
> 
> /
> /
> > /var layer = new OpenLayers.Layer.Vector("WFS", {/
> > /        strategies: [new OpenLayers.Strategy.BBOX()],/
> > /        protocol: new OpenLayers.Protocol.WFS({/
> > /            url:  "http://172.16.23.21:8080/geoserver/wfs",/
> > /            featureType: "sde:DTYT.SSC_RUTAS_2009",/
> 
> /featureType: "DTYT.SSC_RUTAS_2009",
> 
> /
> > /            featureNS: "http://geoserver.sf.net",/
> > /            version: "1.1.0",/
> > /            srsName: "EPSG:4326"/
> > /        })   });/
> 
> Do not use a prefix in featureType -- featureNS takes care of that, by 
> using the namespace URI, not the prefix.
> 
> 
> Regards,
> Andreas.
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091029/26d8d88a/attachment.html


More information about the Users mailing list