1

I have disabled all the controls on google map , Using following parameters ,

var mapOptions = {
        zoom: 15,
        center: new google.maps.LatLng(latitude,longitude),
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        disableDefaultUI: true,
        draggable: false, 
                zoomControl: false, 
                scrollwheel: false,     
    };

But the user can still zoom in and zoom out for the map using double click. Also there are some popups on map which displays some information about that place. How can i disable double click zoom in and the popups that gives information. Is there is something missed in this settings ?

Update

Finally got solution for disabling popups and links on Google map here.

Here is demo

Call this function when map is finished loading.

function fixInfoWindow() {
    var set = google.maps.InfoWindow.prototype.set;
    google.maps.InfoWindow.prototype.set = function (key, val) {
        if (key === 'map') {
            if (!this.get('noSupress')) {
                return;
            }
        }
        set.apply(this, arguments);
    }
}
Community
  • 1
  • 1
Nishant Nawarkhede
  • 8,234
  • 12
  • 59
  • 81

2 Answers2

1
disableDefaultUI: true,
scrollwheel: false,
navigationControl: false,
mapTypeControl: false,
scaleControl: false,

should do it if you're using V3 of Google Maps. If not, you can call map.disableScrollWheelZoom();

To disable popups you could use something like..

markerOptions : {
    visible: true,
    clickable: false
}
Galadre
  • 619
  • 3
  • 6
  • 15
  • Works for me, perhaps you can link to the site so we can check? – Galadre Mar 06 '14 at 12:16
  • 2
    Everything is in the [documentation](https://developers.google.com/maps/documentation/javascript/reference#MapOptions). In addition to the above, and since you asked for it, you can also use `disableDoubleClickZoom: true` to disable the double click zoom. – MrUpsidown Mar 06 '14 at 14:30
  • @MrUpsidown Thanks , i have disabled zoom in and out by adding `disableDoubleClickZoom: true`. I gone through documentation by didn't find any option for disabling links for popups, will you please tell me how to do that ? – Nishant Nawarkhede Mar 07 '14 at 13:36
  • What popups are you talking about? Do you have an example? – MrUpsidown Mar 10 '14 at 10:01
1

If you are trying to disable clickable poi-s, you can hide them using styles option of the map:

var mapOptions = {
    styles: [
        {
            featureType: 'poi.business',
            elementType: 'labels',
            stylers: [
                { visibility: 'off' }
            ]
        }
    ]
};  
map = new google.maps.Map(document.getElementById(mapId),mapOptions);
VMAtm
  • 27,943
  • 17
  • 79
  • 125
Gregor Srdic
  • 446
  • 7
  • 10