V2コードをに変換しています。V3次のコードはgoogle map V2コードです。アラートでは、sw.x何らかの値が来ています。
//Google map V2 code:
function flagIntersectingMarkers() {
var pad = this.borderPadding;
var zoom = this.map.getZoom();
var projection = this.map.getCurrentMapType().getProjection();
var bounds = this.map.getBounds();
var sw = bounds.getSouthWest();
sw = projection.fromLatLngToPixel(sw, zoom);
alert("sw"+sw.x); // In this alert some value is coming
sw = new GPoint(sw.x-pad, sw.y+pad);
sw = projection.fromPixelToLatLng(sw, zoom, true);
}
//Google map V3 code:
function flagIntersectingMarkers() {
var pad = this.borderPadding;
var zoom = this.map.getZoom();
var projection = this.map.getProjection();
var bounds = this.map.getBounds();
var sw = bounds.getSouthWest();
sw = projection.fromLatLngToPoint(sw, zoom);
alert("sw"+sw.x); // Undefined value is coming
sw = new google.maps.Point(sw.x-pad, sw.y+pad);
sw = projection.fromPointToLatLng(sw, zoom, true);
}
しかし、上記のV3コードでは、アラートでsw.x未定義の値が来ています. でsw.x値を取得する方法V3.