开发者

getbounds on google api v2 is not working

getbounds() return error开发者_StackOverflow社区 on firebug. May I know what is the problem? Thanks.

map=new GMap2(document.getElementbyId('map'));
map.setCenter(new GLatLng(la,lo),15);
map.addControl(new GLargeMapControl3D());
map.addControl(new GMapTypeControl());
map.enableScrollWheelZoom();
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var southEast = bounds.getSouthEast();
var northWest = bounds.getNorthWest();

Firebug states that getSouthWest() is not a functions. Thank you.


Maybe you should wait until the map fires load event.


I think the simple problem here is that GLatLngBounds only has getSouthWest() and getNorthEast() methods, not getSouthEast() and getNorthWest() (see the API reference). Are you sure Firebug is giving you an error on getSouthWest? I am able to get your code working without an error if I remove the last two function calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜