Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Pan control in Google Maps API V3

Is there any way to remove the circular panning navigation control but keep the zoom control in the Google Maps V3 API? I've tried forcing it offscreen with jQuery but every time the map is updated it comes back. Any ideas? Thanks!

like image 401
T3db0t Avatar asked Oct 15 '10 16:10

T3db0t


People also ask

How do I turn off controls in Google Maps?

Disabling the Default UI You may wish to turn off the API's default UI buttons entirely. To do so, set the map's disableDefaultUI property (within the MapOptions object) to true . This property disables any UI control buttons from the Maps JavaScript API.

How do I stop Google Earth from panning?

(By the way, one way to straighten the view is to press the letter "R" on the keyboard.) To zoom without tilting, click "Tools" on the Google Earth menu. Then select "Options".

How do I turn off Pegman on Google Maps?

setOptions({streetViewControl: false}); removes the pegman control box in the upper left, but still ends up leaving the pegman on the map. If you want to HIDE the Street View control you need to place streetViewControl option before mapTypeId . Otherwise, you end up with the Street View control showing disabled.

How do I remove a GUI from Google Maps?

Disabling the UI Default Controls We can disable the default UI controls provided by Google Maps simply by making the disableDefaultUI value true in the map options.


1 Answers

You may also have a look in here, you can remove/add specific 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
};

Taking Control of the Google Maps API V3 Controls

like image 79
cdzc Avatar answered Oct 08 '22 22:10

cdzc