How to disable Google Map's Satellite view?

前端 未结 6 1028
孤独总比滥情好
孤独总比滥情好 2020-12-23 15:56

I am working on Google Maps Javascript API V 3.

Everything is working fine but I want to disable the MAP button which appears in the top right area with SATELLITE bu

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 16:23

    var myOptions = {
        zoom: 2,
        center: **Your LatLng object**,
        mapTypeControlOptions: {
          mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID]
        }, // here´s the array of controls
        disableDefaultUI: true, // a way to quickly hide all controls
        mapTypeControl: true,
        scaleControl: true,
        zoomControl: true,
        zoomControlOptions: {
          style: google.maps.ZoomControlStyle.LARGE 
        },
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); // displays in 
    //map.mapTypeControl = false; // OPTIONAL: hides the map control

提交回复
热议问题