How to Disable Scrolling in Google Maps API V3
The Google Maps API V3 (version 3) gives web developers the power to add Google Maps to web pages. The API uses mainly uses the JavaScript programing language, but can be incorporated with Adobe Flash for Flash-enabled websites or with Objective C to create apps for Apple products such as iPod Touch, iPhone and iPad. As the web developer, you can control the different capabilities of the Google Maps you program for your website. This includes disabling scrolling, or scaling, with the scroll wheel.
Instructions
-
-
1
Open the program you are using to create your web page with the Google API V3. This is a web-authoring program that allows JavaScript or a text editor, such as NotePad. Open the file that you added the Google maps to.
-
2
Scroll down in the JavaScript programming code to where you created the Google Map. You have to disable the scrolling in the MapOptions part of the code. This is where you initiated the map and set the different options, such as the map type and navigation controls.
-
-
3
Type in the line that will disable the scrollwheel. In version 3 of the Google Maps API, the scrollwheel options accepts a boolean value of true or false to disable the scrolling function.
"scrollwheel: false,"
An example of the full options code for a Google Maps with version 3 of the API is:
"var myMapOptions = ({
navigationControl: false,
scrollwheel: false,
scalControl: false,
draggable: false,
}, myMapOptions);"
-
4
Save the web page to save the changes to the code.
-
1