Javascript 谷歌地图API+;Wax.g+;IE=小瓷砖

Javascript 谷歌地图API+;Wax.g+;IE=小瓷砖,javascript,google-maps,google-maps-api-3,mapbox,Javascript,Google Maps,Google Maps Api 3,Mapbox,我正在使用谷歌地图上显示自定义分幅。这在我测试过的每个浏览器中都能正常工作,IE除外。在其他浏览器中,平铺渲染正确,但在IE中,平铺渲染为真实自我的较小版本。以下屏幕截图最好地解释了该问题: 它们应该是什么样子: 它们在IE中的外观: 这个问题并非总是发生,如果我平移或缩放,有时会得到大小正确的瓷砖,有时则不会。不确定这是一个蜡问题还是Google Maps API如何呈现自定义覆盖类型的问题。还有其他人经历过这个问题吗?非常感谢您的任何见解 (交叉发布自-那里还没有答案)所以问题是我的图像继承

我正在使用谷歌地图上显示自定义分幅。这在我测试过的每个浏览器中都能正常工作,IE除外。在其他浏览器中,平铺渲染正确,但在IE中,平铺渲染为真实自我的较小版本。以下屏幕截图最好地解释了该问题:

它们应该是什么样子:

它们在IE中的外观:

这个问题并非总是发生,如果我平移或缩放,有时会得到大小正确的瓷砖,有时则不会。不确定这是一个蜡问题还是Google Maps API如何呈现自定义
覆盖类型的问题。还有其他人经历过这个问题吗?非常感谢您的任何见解


(交叉发布自-那里还没有答案)

所以问题是我的图像继承了auto的样式height和width,而Wax.g的
getTile
方法使用
新图像(256,256)
创建了一个
图像
,它写入
img
本身的height和width属性(
img
属性,而不是内联样式)。内联样式优先于属性,因此使用
auto
调整
img
的大小。我通过使用内联样式确保img的高度和宽度为256来解决这一问题

Wax.g代码:

// Get a tile element from a coordinate, zoom level, and an ownerDocument.
wax.g.connector.prototype.getTile = function(coord, zoom, ownerDocument) {
    var key = zoom + '/' + coord.x + '/' + coord.y;
    if (!this.cache[key]) {
        var img = this.cache[key] = new Image(256, 256);
        this.cache[key].src = this.getTileUrl(coord, zoom);
        this.cache[key].setAttribute('gTileKey', key);
        this.cache[key].onerror = function() { img.style.display = 'none'; };
    }
    return this.cache[key];
};
我的修改代码:

// Get a tile element from a coordinate, zoom level, and an ownerDocument.
wax.g.connector.prototype.getTile = function(coord, zoom, ownerDocument) {
    var key = zoom + '/' + coord.x + '/' + coord.y;
    if (!this.cache[key]) {
        var img = this.cache[key] = new Image(256, 256);
        img.style.height = '256px';  // added this line
        img.style.width = '256px';  // added this line
        this.cache[key].src = this.getTileUrl(coord, zoom);
        this.cache[key].setAttribute('gTileKey', key);
        this.cache[key].onerror = function() { img.style.display = 'none'; };
    }
    return this.cache[key];
};