我是 openLayers 的新手并尝试添加 GML 叠加层:
http://the506.com/elxnmaps/2011/ftontest.html
该文件在 Chrome 和 Safari 中完美呈现,但在 Firefox 或 IE 中根本不呈现;只有底层的谷歌层。它与 HTML 页面位于同一目录中。我尝试的任何方法似乎都不起作用。这是有问题的代码:
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()
}
什么可能导致问题,可以修复吗?