I'm new to openLayers and trying to add a GML overlay:
http://the506.com/elxnmaps/2011/ftontest.html
The file renders perfectly as is in Chrome and Safari, but doesn't render at all in Firefox or IE; only the underlying Google layers. It's in the same directory as the HTML page. Nothing I try seems to work. Here's the code in question:
function init(){
map = new OpenLayers.Map('map', {
projection: 'EPSG:3857',
layers: [(Google layers)],
center: new OpenLayers.LonLat(-66.6, 46.0).transform('EPSG:4326', 'EPSG:3857'),
zoom: 10
});
map.addControl(new OpenLayers.Control.LayerSwitcher());
(styling rules)
var kmllayer = new OpenLayers.Layer.Vector("Poll-by-Poll Data", {
protocol: new OpenLayers.Protocol.HTTP({
url: './13003test.gml',
format: new OpenLayers.Format.GML({extractAttributes: true})
}),
strategies: [new OpenLayers.Strategy.Fixed()],
visibility: true,
styleMap: new OpenLayers.StyleMap(style),
projection: new OpenLayers.Projection('EPSG:4326')
});
map.addLayer(kmllayer);
selectControl = new OpenLayers.Control.SelectFeature(kmllayer,
{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
map.addControl(selectControl);
selectControl.activate()
}
What could be causing the problem, and can it be fixed?