Jump to content

[SOLVED] Google map scroll wheel disable


gazever

Recommended Posts

Hi I'm trying to disable the mouse wheel scroll function on google maps, here is my code, cannot figure out where to put the following code into it

 

disableScrollWheelZoom()

 

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var house = new google.maps.LatLng('.$lat.','.$lon.');
var hollywoodstudios = new google.maps.LatLng(28.3576995,-81.5610138); 
var epcot = new google.maps.LatLng(28.3737300,-81.5492050); 
var universal = new google.maps.LatLng(28.4722601,-81.4690932);   
var seaworld = new google.maps.LatLng(28.4095199,-81.4622289 ); 
var magickingdom = new google.maps.LatLng(28.4197794,-81.5802069); 
var animalkingdom = new google.maps.LatLng(28.3575650,-81.5903850); 
var image = \'http://www.debbiesvillas.co.uk/images/villa_icon.gif\';
var myOptions = {
	zoom: 11,
      		center: hollywoodstudios,
	mapTypeControl: true,
	disableScrollWheelZoom:true,
      		mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
      		navigationControl: true,
      		navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
      		mapTypeId: google.maps.MapTypeId.ROADMAP 
    	}
    	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

 

Thanks

Link to comment
Share on other sites

Sussed it myself,

 

was trying to use V2 code in my V3 api,

 

this is the fix if anyones interested

var myOptions = {
	zoom: 11,
      		center: hollywoodstudios,
	mapTypeControl: true,
      		mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
      		navigationControl: true,
      		navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
      		mapTypeId: google.maps.MapTypeId.ROADMAP, 
	scrollwheel:false
    	}

 

just set scrollwheel to false

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.