Search code examples
google-mapsgoogle-maps-api-2

How can I disableDefaultUI in Google Maps API v2?


I have a script that renders a Google maps and uses the API v2. I am trying to disable the Zoom functions/map type/etc but I can't seem to figure out where to instert disableDefaultUI

function initialize() {
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl()); 
        map.addControl(new GMapTypeControl());  
        map.setCenter(new GLatLng(37.4419, -122.1419), 14);
        map.enableScrollWheelZoom();
        geocoder = new GClientGeocoder();
        GEvent.addListener(map, "click", clicked);
    }
}

Solution

  • Just remove these two lines:

    map.addControl(new GLargeMapControl()); 
    map.addControl(new GMapTypeControl());