user1312312
user1312312

Reputation: 635

Google maps Api Version 2 to Google maps Api Version 3

I was using the following code to find the center and zoom in my code which was using google maps api V2.

function calculaCentro(points){
alert("in calcula Centro");
    var gbounds = new GBounds(points);
    alert("gbounds is" +gbounds);
    var center = gbounds.mid();
    return center;
}


function calculaZoom(points){
alert("in calcula zoom");
    var gbounds = new GBounds(points);
    var n = new GLatLng(gbounds.min().y,gbounds.min().x);
    var s = new GLatLng(gbounds.max().y,gbounds.max().x);
    var zoom = map.getBoundsZoomLevel(new GLatLngBounds(n,s));
    return zoom;
}

Now I want to convert it to google maps Api V3.But couldnt find any exact replacement for GBounds.Can anyone please help me?

Upvotes: 0

Views: 507

Answers (1)

duncan
duncan

Reputation: 31912

What you want instead is LatLngBounds

https://developers.google.com/maps/documentation/javascript/reference#LatLngBounds

Upvotes: 1

Related Questions