Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps removing controls

I am attempting to create a Google map of my company location. I used the link button on the Google maps page. Everything's fine, but when I shrink the map to 200 x 200 all the maps controls take over the map and blocks the view from the map. Is there a way to get ride of them? All I want is the pin and the zoom in and out button. Thank you.

<iframe width="200" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"    src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=244+5th+Avenue,+New+York,+NY&amp;aq=t&amp;sll=37.0625,-95.677068&amp;sspn=48.956293,107.138672&amp;ie=UTF8&amp;hq=&amp;hnear=244+5th+Ave,+New+York,+10016&amp;ll=40.744556,-73.987378&amp;spn=0.005763,0.013078&amp;t=m&amp;z=14&amp;output=embed"></iframe><br /><small><a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=244+5th+Avenue,+New+York,+NY&amp;aq=t&amp;sll=37.0625,-95.677068&amp;sspn=48.956293,107.138672&amp;ie=UTF8&amp;hq=&amp;hnear=244+5th+Ave,+New+York,+10016&amp;ll=40.744556,-73.987378&amp;spn=0.005763,0.013078&amp;t=m&amp;z=14" style="color:#0000FF;text-align:left">View Larger Map</a></small>
like image 496
Eric Goncalves Avatar asked Jul 04 '12 18:07

Eric Goncalves


People also ask

How do I get Google Maps back to normal?

Reset only the maps/route/navigation app Access Settings in your Android smartphone or tablet. Choose Apps. In the list of apps choose the app used by default to access maps/routes/navigation (Maps for GoogleMaps, or Waze). Choose the Launch by default function.

How do I hide the menu bar in Google Maps?

They announced it in the Google Maps Help forum saying: We've heard your feedback that that you'd like to be able to see the entire map by hiding the search box and side panel. To hide the panel, go to the right of the panel and click the arrow.

How do I turn off Pegman on Google Maps?

> You should be able to set streetViewControl:false inhttp://code.google.com/apis/maps/documentation/javascript/reference.h... > > streetview pegman on my map. > > pegman too.


2 Answers

To customize the interface, I believe you have to delve into the Google Maps API.

Using the Google Maps API, you can set disableDefaultUI to true.

HTML File:

<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="map.js"></script>
</head>
<body>
    <div id="map" style="width:200px; height:200px;" />
</body>
</html>

JavaScript file:

window.onload = function() {
    var myOptions = {
        center: new google.maps.LatLng(40.744556,-73.987378),
        zoom: 18,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        disableDefaultUI: true
    };

    var map = new google.maps.Map(document.getElementById("map"), myOptions);
}
like image 81
jeff Avatar answered Sep 19 '22 08:09

jeff


I don't believe it is possible to hide controls when embedding the map. You will need to create a map in javascript by using Google Maps API - in lines of the following:

var mapContainer = document.getElementById('mapContainer');
var mapOptions = {
    panControl: false,
    zoomControl: false,
    scaleControl: false,
};
var map = new google.maps.Map(mapContainer, mapOptions);
like image 33
Nikola Anusev Avatar answered Sep 22 '22 08:09

Nikola Anusev