Internet Explorerの問題を解決するために私が最終的に実装したのはこれです。
(IEの場合)マーカーレイヤーのすべての画像をsvgに置き換えます。これにより、IE は「pointer-events:none」を認識できるようになり、イベントは下のレイヤーに渡されます。ただし、マップのズームが変更されると、OpenLayers ライブラリは画像 (私が信じている位置にあるもの) を見つけることを期待しているため、ライブラリがクラッシュし、マップはズームしません。
そのため、ハンドラーを「movestart」イベントにアタッチし、元の OpenLayers 画像を復元し、マップの移動が停止したら (短いタイムアウトの後)、画像を svg に再度置き換えます。
ご想像のとおり、これはかなり CPU を集中的に使用します。私が持っていた時間枠ではありましたが、より良い解決策を思いつくことができませんでした。
関連するコードは次のとおりです。
「kmlInit」は、kml レイヤーが読み込まれたかどうかを示します
「マーカー」はマーカーレイヤーです
「getInternetExplorerVersion」は、IE 以外のブラウザが見つかった場合は -1、そうでない場合はバージョンを返す関数です。
if (getInternetExplorerVersion()>-1){
map.events.register('movestart',this,function(e){
if(kmlInit){
ieSucksRestore();
}
});
map.events.register('moveend',this,function(e){
if(kmlInit){
if (ieCrap){
clearTimeout(ieCrap);
}
ieCrap=setTimeout(ieSucks,1000); //to give time for multiple move/zooms
}
});
}
function ieSucks()
{
if ($(markers.div).find(".olAlphaImg").length>0){
try{
$(markers.div).find(".olAlphaImg").replaceWith(function(){
var css = this.style;
var src = this.src;
var elem = $("");
var width = parseInt(css.width, 10);
var height = parseInt(css.height, 10)
var img = document.createElementNS('http://www.w3.org/2000/svg','image');
var elem = document.createElementNS('http://www.w3.org/2000/svg','svg');
elem.setAttributeNS(null,"class",'svgHack');
elem.setAttributeNS(null,"x",'0');
elem.setAttributeNS(null,"y",'0');
elem.setAttributeNS(null,"width",width);
elem.setAttributeNS(null,"height",height);
elem.setAttributeNS(null,"pointer-events","none");
img.setAttributeNS(null,"x",'0');
img.setAttributeNS(null,"y",'0');
img.setAttributeNS(null,"width",width);
img.setAttributeNS(null,"height",height);
img.setAttributeNS('http://www.w3.org/1999/xlink',"href",src);
elem.appendChild(img);
return elem;
});
}catch(err){console.log(err.message);}
}
}
function ieSucksRestore()
{
if ($(".svgHack").length>0){
try{
$(".svgHack").replaceWith(function(){
var svg=$(this);
var id = svg.parent()[0].id;
var img = svg.children()[0];
var newimg = $("");
newimg.css('height',img.height+"px");
newimg.css('width',img.width+"px");
newimg.css('position','relative');
newimg.attr("src",img.href.baseVal);
newimg.attr("class","olAlphaImg");
newimg.attr("id",id+"_innerImage");
return newimg;
});
}catch(err){console.log(err.message);}
}
}