1

Google マップ用のカスタム オーバーレイを作成しようとしています。この例を使用します。また、オーバーレイ幅の定義に問題があります。

var sw = overlayProjection.fromLatLngToDivPixel(this.bounds_.getSouthWest());
var ne = overlayProjection.fromLatLngToDivPixel(this.bounds_.getNorthEast());

// Resize the image's div to fit the indicated dimensions.
var div = this.div_;
div.style.left = sw.x + 'px';
div.style.top = ne.y + 'px';
div.style.width = (ne.x - sw.x) + 'px';
div.style.height = (sw.y - ne.y) + 'px';

このコードは、この latlonbox を使用したオーバーレイに対して 1 ピクセル未満の幅を返します。

<LatLonBox>
<north>90.0</north>
<south>-90.0</south>
<east>180.0</east>
<west>-180.0</west>
</LatLonBox>

誰かがこの問題に遭遇しましたか? 誰かが解決策を知っているかもしれません。どんな助けにも感謝します。

4

1 に答える 1