おはようございます。
オーバーレイを使うのは、書かれた地図を上から消す形になるので、レイテンシが発生すると
見た目がしょぼくなりそうなので嫌だったのですが、実際に試してみると、それほど問題なさ
そうだったので、とりあえずはこれでやってみます。
ありがとうございました。
実際のコードイメージ:
function MaskMapType() {
}
MaskMapType.prototype.tileSize = new google.maps.Size(256,256);
MaskMapType.prototype.createTransparentTile = function(ownerDocument){
var div = ownerDocument.createElement('DIV');
div.style.width = this.tileSize.width + 'px';
div.style.height = this.tileSize.height + 'px';
return div;
}
MaskMapType.prototype.createBlackTile = function(ownerDocument){
var div = this.createTransparentTile(ownerDocument);
div.style.backgroundColor = "#000000";
return div;
}
MaskMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
var max = Math.pow(2,zoom) - 1;
if (!( coord.x < 0 || coord.x > max || coord.y < 0 || coord.y > max
)) return this.createTransparentTile(ownerDocument);
return this.createBlackTile(ownerDocument);
};
var map = new google.maps.Map(div,mapOptions);
map.overlayMapTypes.insertAt(0, new MaskMapType());
2010年4月23日14:21 YON <
yyr...@gmail.com>:
--
HTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHT
株式会社ATR-Promotions ミュージアムメディア事業部
プロデューサ
大塚 恒平
〒619-0228「けいはんな学術学研都市」光台2-2-2
TEL:0774-95-2636 FAX:0774-95-1191
Mail:
koht...@atr-p.com
HTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHTHT