Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Zoom on new Google Maps Engine

I'm trying to disable the scrolling/zooming in and out aspect of this page:

http://s1magazine.co.uk/NSA/pages/services/

Everytime I scroll past it it it just zooms in, how can I disable it?

<h2>NSA is a national competition happening throughout England.</h2>
<h2><!-- Responsive iFrame -->
<!-- Responsive iFrame --></h2>
<div class="Flexible-container"><iframe src="http://mapsengine.google.com/map/u/0/embed?    mid=zyaBPLJJ7er8.kdbvNz_CrEYk" height="350" width="425" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
like image 403
Kakarotto57 Avatar asked Oct 22 '22 02:10

Kakarotto57


1 Answers

The better way to custom google maps is to work directly with the google maps api. For the specific case, you can set the scrollwheel false in the map options and disable the scrolling/zooming

<style>
    html, body, #map-canvas {
       height: 100%;
       margin: 0px;
       padding: 0px
    }
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
    var map;
    function initialize() {
        var mapOptions = {
            zoom: 8,
            center: new google.maps.LatLng(-34.397, 150.644),
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            scrollwheel: false  
        };
        map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    }

    google.maps.event.addDomListener(window, 'load', initialize);

</script>


<div id="map-canvas"></div>
like image 161
Guilherme Avatar answered Oct 27 '22 08:10

Guilherme