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
https://forums.phpfreaks.com/topic/172808-solved-google-map-scroll-wheel-disable/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.