Zooming in the center on a map in the Google V3 Maps API

I'm new to using google maps and trying to figure out how to limit the zoom function so that it doesn't get distorted anywhere except the center of the map, and doesn't grow to the point of the mouse. It basically scales to the center of the returned map, regardless of where the mouse pointer is on the map, rather than scaling where the mouse pointer is on the map. I don’t even know if this is currently possible, some help would be appreciated.

<script type="text/javascript">
        function initialize() {
        var latlng = new google.maps.LatLng(51.285583, 1.091045);
        var myOptions = {
        zoom: 15,
        center: latlng,
        scrollwheel: true,
        navigationControl: false,
        mapTypeControl: false,
        scaleControl: false,
        draggable: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);

        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(51.285826, 1.089973),
            map: map,
            title: 'Run of The Mill',
            clickable: true
            });
        }
    </script>
+5
source share
3 answers

There are several types of scaling:

  • using zoom control - zoom to the center of the map.
  • - ,
  • - ,

, , , disableDoubleClickZoom scrollwheel map false.

, dblclick map ( , , , javascript), map.setZoom(). . .

+5

, . .

google.maps.event.addListener(map,'zoom_changed',function () {
  map.setCenter(new google.maps.LatLng(47.61388802057299,-122.31870898147581));
})
+2

, , latlng, . . myOptions . , 51.285583, 1.091045, Caterbury Kent .

, , , Google , .

http://code.google.com/apis/maps/documentation/javascript/examples/index.html

0

All Articles