views:

619

answers:

2

Hello,

Is there a way to only show the "3D" style panning control in Google maps, i.e. don't show the zoom controls.

Regards, Jonathan

+1  A: 

I think the best you can do with the standard controls is GSmallZoomControl3D(). This is a 3D panning control without the zooming slider, but with a zoom in and zoom out button:

http://code.google.com/apis/maps/documentation/reference.html#GControl

Otherwise you can subclass GControl and implement your own 3D panning control. There is a description of this here:

http://code.google.com/apis/maps/documentation/controls.html#Custom%5FControls

Or for a trivial solution ... See ChrisB's answer ;)

Cannonade
In the end, we went down this route. We had to implement our own zoom functionality, so we went all the way and did the panning too.
Jonathan
I am glad my answer was useful. :)
Cannonade
+2  A: 

You can easily accomplish this with CSS. Usually this would be difficult in the Google Maps API, but fortunately each element of the 3d Control has an id.

Add the 3d control:

map.addControl(new GLargeMapControl3D());

Add these styles to your page:

#lmcslider { display:none; }
#lmczo { display:none; }
#lmczb { display:none; }
#lmc3d { height:58px; }
Chris B
+1 What a cool solution. I tried this out here and it worked perfectly. http://www.cannonade.net/geo.php?test=geo2
Cannonade
Interesting idea...although I'm just a little reluctant to do this as it doesn't go through their API. What's the possibility of Google changing those class names in a future release?
Jonathan
That is a great point. It's seems unlikely that they'll change - but it's definitely a possibility.
Chris B