私はopenLayersが初めてで、GMLオーバーレイを追加しようとしています:
http://the506.com/elxnmaps/2011/ftontest.html
このファイルは、Chrome と Safari ではそのまま完全にレンダリングされますが、Firefox や IE ではまったくレンダリングされません。基盤となる Google レイヤーのみ。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()
}
問題の原因は何ですか?修正できますか?