On Dec 8, 2:59 am, Duong Nguyen <[email protected]> wrote:
> Hi,
> I am trying to zoom in 1 level further than the auto zoom feature of
> Google Maps. Briefly, I load the kml layer, let the map auto zoom into
> the region of the markers, then increase the zoom level by 1 with
> setZoom() and getZoom() functions. However, it does not work. The map
> does not load at all. The map loaded fine before I modified its zoom
> level.
> Here are the link and
> codes:https://mekong.rmit.edu.vn/~s3231181/api/WWF%20Map.html
>
> function initialize() {
> var myOptions = {
> mapTypeId: google.maps.MapTypeId.ROADMAP
> }
>
> var map = new google.maps.Map(document.getElementById("map_canvas"),
> myOptions);
>
> // URL of the kml file
> var kmlUrl = 'https://mekong.rmit.edu.vn/~s3231181/api/2785Non-
> survey.KML';
>
> var resLayer = new google.maps.KmlLayer(kmlUrl + '?dummy=' + (new
> Date()).getTime());
> resLayer.setMap(map);
How about if you do this?
google.maps.event.addListenerOnce(map, "zoom_changed", function() {
var newZoom = map.getZoom() + 1;
map.setZoom(newZoom);
});
The Google Maps API v3 is event driven.
--- Larry
>
> Please advise a solution.
> Thank you,
> Duong
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.