I want to add codes inside disable() function to disable dragging and zooming in Google maps API v3 by clicking on \'disable\' button.
You can use the setOptions() method on the map object:
map.setOptions({draggable: false, zoomControl: false, scrollwheel: false, disableDoubleClickZoom: true});
If this doesn't prevent zooming, you could always set the minimum and maximum zoom to the current zoom level.
There is also the disableDefaultUI option, which probably takes all of these events into account, but it might disable clicking on existing elements.