1
我正在使用最新的LeafletJS庫在地圖上顯示某些彈出選項。單張JS:彈出選項聲明在IE8中失敗,但在Firefox和Chrome中可以正常使用
它工作在Firefox和Chrome罰款,但隨着錯誤消息IE8失敗:
參數無效。 leaflet.js,6號線,字符14452
是:
i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height=""
這個問題似乎很明顯是與popupOptions聲明 - 在取消的時候他們在IE8中沒有出現的js錯誤,但當然這些選項也不適用。
所以我想知道,語法有什麼問題?
function onEachFeature(feature, layer) {
var popupContent = '...';
if (feature.properties && feature.properties.popupContent) {
popupContent += feature.properties.popupContent;
}
var popupOptions =
{
'minWidth': '491px',
'maxWidth': '491px',
'closeButton': false
}
layer.bindPopup(popupContent, popupOptions);
}
謝謝,僅此而已。曾經習慣於使用css的單位。 – 2013-05-08 08:59:19