[OpenLayers-Users] creating a persistent vector/feature object from wfs

G. Allegri giohappy at gmail.com
Thu Jun 12 08:52:41 EDT 2008


I get the following error:

this.initialize has no properties

It's the same if I save the GML locally.
I could reach my task creating a Vector layer inside
Tile.WFS.requestSuccess(), but I prefer to solve it using GML layer as
it's more clear and it saves lines of code.
Following I attached a little excerpt from my code...

<script>
var map, layerGML;

    function init() {

	var bounds = new OpenLayers.Bounds(1612519,5059567,1728691,5157164);
  	var lat = 1700000;
        var lon = 5130000;
        var zoom = 3;

	var options = {
	maxExtent: bounds,
	//maxResolution: 226,
	maxResolution: 'auto',
	units: 'm',
	projection: "EPSG:3003"
	}

	var map = new OpenLayers.Map('map',options);
	
	layerGML = OpenLayers.Layer.GML("IET_GML","IET.gml",{isBaseLayer:true})
	map.addLayer(layerGML);

	map.addControl(new OpenLayers.Control.LayerSwitcher());
	map.zoomToExtent(bounds);

	var Zelection= new OpenLayers.Control.SelectFeature(
	layerGML,{hover:true});
	map.addControl(Zelection);
	Zelection.activate();
}
</script>

2008/6/12 Christopher Schmidt <crschmidt at metacarta.com>:
> On Thu, Jun 12, 2008 at 02:34:49PM +0200, G. Allegri wrote:
>> Ok, I had already tried Layer.GML putting the whole wfs request url
>> inside it, but it didn't seem to work...
>>
>> OpenLayers.Layer.GML("IET_GML","http://localhost/IETclient/wxsIET.php?TYPENAME=ammsimple3&FORMAT=GML&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3003&BBOX=1612519,5108846.747534517,1661798.7475345167,5158126.495069034")
>>
>> What's wrong with this?
>
>
> Looks fine to me. You'll need to be more explicit about what 'doesn't
> work' means -- preferably, by puttin together a simple xaple. One thing
> that I would try would be to downloada the WFS data to a file, and try
> loading just that file, to see if it works any better for you.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>



More information about the Users mailing list