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

disable all other views not including map view Gmap2


I am using Google Map v2 and I only want map view and nothing more. I also would like to get rid of the zoom in and out buttons.

If anyone knows what I need to add to the following that would be great.

function stores()
{
    $('#storelist ul#stores').html("");
    fetch(203,"task=location&location=vic");
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(-37.810013, 144.962683), 8);
    map.setUIToDefault();
    yellowIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/orange/blank.png";

    markerOptions = { icon:yellowIcon };

}

Solution

  • Remove map.setUIToDefault(). It adds the default look and feel to the Map. (Reference docs: http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.setUIToDefault)

    If you want, you can also customise how the map can be interacted with. For example map.disableDoubleClickZoom() or map.disableDragging(). See the reference above for details.