Search code examples
google-mapsgoogle-maps-embed

Google Maps: how do i change the default zoom?


I've created a simple real-estate website with a Google-map via Google-'My Maps'.

The site has a photo-album with a bunch of pics. I've used some of these pics to create 'My Maps' - a Google mapping thingy which allows you to add pics to a private map just for your web-site.

The map renders on my website just fine, except, the markers are all scrunched up. How do I give that map a higher 'Zoom' so they don't look so cluttered.

Note: I've read http://marcgrabanski.com/jquery-google-maps-tutorial-basics/ but here, he starts from scratch by loading the default map for a particular lat/long using

var burnsvilleMN = new GLatLng(44.797916,-93.278046);

and then adds all the markers:

marker = new GMarker(point);

I have an existing 'My Maps' map https://www.google.com/maps/d/embed?mid=zMUI-z11i1mw.k7KikFgwemt0 that I need to modify (the center is set) from within 'My Maps'.


Solution

  • have you tried minZoom and maxZoom properties from google map options with default of 0

    var mapOptions = {
          center: { lat: -34.397, lng: 150.644},
          zoom: 8
        };
        var map = new google.maps.Map(document.getElementById('map-canvas'),
            mapOptions);
    

    for embedded map use z insted of zoom

    https://www.google.com/maps/d/embed?mid=zMUI-z11i1mw.k7KikFgwemt0&z=6