How can i toggle the controls such as Zoom, Pan, Scale, MapType, Street View, Overview Map controls in Maps API V3?

433 views
Skip to first unread message

shiva

unread,
Jul 18, 2011, 12:29:15 PM7/18/11
to google-map...@googlegroups.com
Hello Everybody,

I am new to Google Maps API but I am familiar with Google Earth Plugin API. I wanted know how to toggle (hide/show) the Zoom, Pan, Scale, MapType, Street View, Overview Map controls in Maps API V3, which can be easily achieved in Google Earth Plugin API - like in the following example .

Regards,
Shiva

Shreerang Patwardhan

unread,
Jul 18, 2011, 1:56:09 PM7/18/11
to google-map...@googlegroups.com
Hi Shiva,

You will find the following example on my blog helpful...

http://shreerangpatwardhan.blogspot.com/2011/07/playing-with-map-controls.html

Hope this helps!

-Shreerang

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/VNywn7HJwX4J.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



shiva

unread,
Jul 18, 2011, 2:38:13 PM7/18/11
to google-map...@googlegroups.com
Hello Shreerang,

    Thanks for replying. That worked. Is there a direct way to find whether the controls already visible/enabled or vice versa, i.e, the current status of the control on the map?

Regards,
Shiva

jufemaiz:Joel Courtney

unread,
Jul 19, 2011, 3:06:53 AM7/19/11
to Google Maps JavaScript API v3
As per reference material @ http://code.google.com/apis/maps/documentation/javascript/reference.html

I'd advise using the google.maps.MapOptions object in a more global
sense and updating that before pushing it onto the map as a convention
based approach to maintaining state.

There may be a better direct have from the google.maps.Map object
> achieved in Google Earth Plugin API - like in the following example<http://earth-api-samples.googlecode.com/svn/trunk/demos/options/index...>.
>
> Regards,
> Shiva

Shreerang Patwardhan

unread,
Jul 19, 2011, 10:42:39 AM7/19/11
to google-map...@googlegroups.com
Hi Shiva,

google.maps.mapOptions object has a disableDefaultUI property, which has a boolean value. You can use this to check whether the controls are present or absent.

-Shreerang

>
> Regards,
> Shiva

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
Reply all
Reply to author
Forward
0 new messages