Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable 45 degree option in Google Maps Javascript API 3.x

I want remove the option for the user to put the map into 45 degree tilt mode from the satellite view. I can set the default tilt by calling setTilt(0) on the Map object, but when the map is displayed, and the user clicks on the Satellite option in upper right of map, it still shows the 45 degree option.

How can I eliminate the 45 degree option, and still have the user able to switch between road and satellite view.

like image 937
Fraggle Avatar asked Mar 13 '12 23:03

Fraggle


People also ask

How do I hide the controls on Google Maps?

Google Maps - Turn On All Controls Adding or removing controls from the map is specified in the Map options object. Set the control to true to make it visible - Set the control to false to hide it.


1 Answers

The best kludge I've found to solve this involves both setting the tilt parameter in map options, and also hiding the popup using css attribute selectors. In the other solutions, a user can still switch manually to the 45º view.

Map Options

var mapOptions = {
    tilt:0,
    //all other map options
}

CSS to hide the popup (when mousing over the 'Satellite' control).

[title=Show\ 45\ degree\ view]
{
    display:none;
}
like image 69
Paul Gibbs Avatar answered Sep 22 '22 06:09

Paul Gibbs