Delete panning control in Google Maps API V3

Is there a way to remove the panning pan control but keep the zoom control in the Google Maps V3 API? I tried to force it off-screen using jQuery, but every time the map is updated, it returns. Any ideas? Thanks!

+6
javascript jquery google-maps google-maps-api-3
source share
3 answers

You can use google.maps.NavigationControlStyle.SMALL to display a small plus / minus zoom control, otherwise you will have to create your own zoom control and add it to the map.

http://code.google.com/apis/maps/documentation/javascript/controls.html

+6
source share

You can also look here, you can remove / add certain controls when you declare your map:

 var latlng = new google.maps.LatLng(40.44062, -79.99588); var options = { zoom: 14, center: latlng, disableDefaultUI: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; 

Manage Google Maps V3 API controls

+10
source share

In V3, when you define your parameters, you have the option to disable / enable any user interface functions:

 function initialize() { var mapOptions = { zoom: 4, center: new google.maps.LatLng(-33, 151), //panControl: false, zoomControl: false, scaleControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); } 
+6
source share

All Articles