In OL 2.13.1 I'm getting this error:
"TypeError: this.container is null" in OpenLayers.debug.js (line 57513)
whenever I supply an id property to my Vector layer during construction. If I
don't set an id on the layer everything works fine, but I want to use the id to
find the layer later. The layer is being added dynamically as shown below.
var icaoLayer = new OpenLayers.Layer.Vector('myFeature', {
strategies: [new OpenLayers.Strategy.Fixed()],
id: 'myFeatureId',
protocol: new OpenLayers.Protocol.WFS({
url: '/server/wfs',
version: '1.1.0',
featureType: 'myFeatureType',
featureNS: 'namespace',
srsName: 'EPSG:4326',
outputFormat: 'json',
maxFeatures: 1
}),
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: 'stationid',
value: stationId
}),
visibility: true
});
icaoLayer.events.register('loadend', icaoLayer, function (evnt) {
var zoomLevel = 11;
openLayersMap.moveTo(new
OpenLayers.LonLat(evnt.response.features[0].geometry.x,
evnt.response.features[0].geometry.y), zoomLevel);
});
openLayersMap.addLayer(icaoLayer);
Is there something wrong with my code? This seems like a bug but I wanted to
ask here before entering it.
Thanks,
Tom
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users