On May 17, 9:04 am, Web-ID <cedric.we...@gmail.com> wrote:
> Hi!
>
> I have a problem with the two methods fitBounds and getBounds ...
>
> Look at this example :
>
> var map = new google.maps.Map(document.getElementById('map'), {
>             zoom: 10,
>             mapTypeId: google.maps.MapTypeId.ROADMAP
>
> });
>
> var ne = new google.maps.LatLng(49.018140928715304, 2.5789534085937476);
> var sw = new google.maps.LatLng(48.694669918528504, 2.1230207914062476);
> var latLngBounds = new google.maps.LatLngBounds(sw, ne);
> map.fitBounds (latLngBounds);
>
> google.maps.event.addListener(map, 'bounds_changed', function() {
>             alert (map.getBounds().getNorthEast().lat());
> // return 49.17909301188814
>
> });
>
> Why my North East Latitude has no exactly the same value than the alert ?

Why should it be?

fitBounds is only supposed to make viewport on the map show the
argument bounds (so the viewport can be bigger than the argument
bounds, but cannot be smaller).

map.getBounds returns the actual bounds of the viewport.  There is
nothing that I know of that says they have to be the same.

  -- Larry

>
> Thank's for your comments ...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to