3

Morning,

So currently in my project i am using an embeded google maps API with JS in my blazor project. The map is on the page and fucntional. I used tips from this following article on stack overflow (Launch Google Maps On Blazor)

Using the following JS in my _Hosts file I need to remove certain features of the map in JS

    <script>
        function initialize() {
            var latlng = new google.maps.LatLng(40.716948, -74.003563);
            var options = {
                zoom: 14, center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById
                ("map"), options);
        }
    </script>

Any pointers on where i can find the code to turn features off?

I need to remove these features that open full screen or a new tab

I need to remove these features that open full screen or a new tab **image**

enter image description here

1 Answers1

5

Have you tried disabling 'disableDefaultUI: true'

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 4,
    center: {lat: -33, lng: 151},
    disableDefaultUI: true
  });
}

Check documentation https://developers.google.com/maps/documentation/javascript/controls

Learning
  • 19,469
  • 39
  • 180
  • 373
  • Thank you! Yes that worked for the full screen however its not removing the small buttons at the bottom. I will have a look into it with the link you provided thank you. Couldn't find anything online – George Harrison Jan 30 '20 at 09:45
  • 2
    try ` scaleControl: true, overviewMapControl: true,` – Learning Jan 30 '20 at 09:56