Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="map" class="pull-right"></div>
  
  <script src="https://maps.googleapis.com/maps/api/js?libraries=places&callback=initMap" async defer></script>
</body>
</html>
 
#map {
  width: 400px;
  height: 400px;
}
 
function initMap() {
        // Definição do ponte de inicialização do mapa
        var myLatLng = new google.maps.LatLng(-5.843470, -36.619855);
        // Definição das configurações visuais do mapa
        var mapOptions = {
            zoom: 8,
            center: myLatLng,
            styles: [
                { 
                    featureType: 'road',
                    elementType: 'all',
                    stylers:[{visibility: 'off'}]
                },
                {
                    featureType: 'water',
                    elementType: 'all',
                    stylers:[{color: '#ffffff'}]
                },
                {
                    featureType: 'landscape',
                    elementType: 'all',
                    stylers:[{color: '#ffffff'}]
                }
            ]
        }
        // Instanciando o mapa com as configurações defidas dentro de uma div cujo id está especificado na instrução
        var map = new google.maps.Map(document.getElementById('map'),mapOptions);   
        var geocoder = new google.maps.Geocoder;
    }
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers