sg

Pazar, Kasım 27, 2005

Re: API Bug: map.center equal open infoWindow anchor?


After a little algebra, a more compact version of the function you
suggest is:

function getMapCenter() {
var bounds = map.getBoundsLatLng();
cenlat = (bounds.maxY + bounds.minY)/2.0;
cenlng = (bounds.maxX + bounds.minX)/2.0;
var cpoint = new GPoint(cenlng,cenlat);
return cpoint;
}

this is close to the best work around, I'm sure. You could make a much
less readable version by writing it as:

function getMapCenter() {
var bounds = map.getBoundsLatLng();
return new GPoint(.5*(bounds.maxX + bounds.minX),.5*(bounds.maxY +
bounds.minY));
}

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık