Set a default zoom for google maps

3

Good morning,

I have a question about google maps. I have a location map of a company, but I would like to place a default zoom, for example, zoom 3, which when opening the page, zoom 3 automatically.

    <iframe width="940" height="368" frameborder="0" scrolling="no"
            marginheight="0" marginwidth="0"
            src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3600.4437971068405!2d-54.5645733!3d-25.52359!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94f690f5e6033f2f%3A0x3b3245f53467c160!2sZeni+Motors!5e0!3m2!1spt-BR!2sbr!4v1442932960309"></iframe>
    
asked by anonymous 30.09.2016 / 13:40

1 answer

3

Here's a script with mouse scrolling options, zooming, and more:

 <script type="text/javascript" src="https://maps.google.com/maps/api/js"></script><script>//Chamarmapafunctioninitialize(){//Createamapobject,andincludetheMapTypeIdtoadd//tothemaptypecontrol.varlatlng=newgoogle.maps.LatLng(-27.230399,-52.028978);varmyOptions={zoom:15,center:latlng,//localizacaodoponteiro,definidaacimanavarlatlng.scrollwheel:false,//desativarscrollmapTypeControl:false,//desativaopcaodeescolhademapapanControl:false,//desativamovimentacaonomapa//zoomControl:false,//desativazommnomapa};varmap=newgoogle.maps.Map(document.getElementById("mapa_localiza"), //mapa_localiza é o id o quale usado na div a baixo para chamar o mapa.
                            myOptions);
                        //define o ponteiro 
                        var image = '<?php print base_url(); ?>web-files/site/img/marker.png';
                        var beachMarker = new google.maps.Marker({
                            position: latlng,
                            map: map,
                            icon: image
                        });
                    }
                    google.maps.event.addDomListener(window, 'load', initialize);
                </script>

                <div id="mapa_contato">
                    <div id="mapa_localiza" style="height: 26em; width: 100%; float: left;"></div><!--CHAMA O MAPA, define altura do mesmo-->
                </div>

In the Zoom field, you can set the initial zoom. In var image you can set the map cursor.

    
30.09.2016 / 13:57