Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="mapa" class="mapa"></div>
              
            
!

CSS

              
                .mapa{
  position: relative;
  width: 100%;
  height: 300px;
}
              
            
!

JS

              
                // Simples função para executar o Google Maps.
// Basta trocar os valores nas variáveis aqui em cima e tudo estará pronto.
// Não esqueça de adicionar o arquivo do Google Maps + jQuery ao seu site.
// :)

function googleMaps(id) {
  	var map,
        latitude = 48.856614, // Latitude do local
        longitude = 2.352222, // Longitudade do local
        mobile = 480, // Tamanho em pixels da tela para desabilitar o touch do mapa
        pointer = true, // Adicionar marcador ao ponto principal
        info = false, // Adiciona uma infobox abaixo do marcador
        mapName = "Casa Esperança", // O nome do seu ponto no mapa
        bgColor = "#000", // Cor do background
        fontColor = "#333333", // Cor das fontes (obrigatório 6 numeros/letras)
        roadColor = "#EEE3CD", // Cor das ruas (obrigatório 6 numeros/letras)
        roadBorder = "#C9B99F", // Cor das bordas das ruas (obrigatório 6 numeros/letras)
        placeColor = "#DACCB1", // Cor dos bairros (obrigatório 6 numeros/letras)
  		 buildColor = "#83b918"; // Cor de lugares próprios (obrigatório 6 numeros/letras)
  
  	
		// A partir daqui a mágica acontece, evite alterar ;)
		var latlng = new google.maps.LatLng(latitude, longitude);
     var isDraggable = $(document).width() > mobile ? true : false;
    
		var options = {
				backgroundColor: bgColor,
				disableDefaultUI: true,
				zoom: 17,
				center: latlng,
          draggable: isDraggable,
				scrollwheel: false,
				mapTypeId: google.maps.MapTypeId.ROADMAP,
				styles: [
					{
						"featureType": "landscape.natural",
						"elementType": "geometry.fill",
						"stylers": [
						{ "color": "#000" }
						 ]
					},
					{
						"featureType": "landscape.man_made",
						"stylers": [
						{ "color": ""+placeColor+"" }
						]
					},
					{
						"featureType": "road",
						"stylers": [
						{ "color": ""+roadColor+"" }
						]
					},
          	{
              "featureType": "poi",
              "elementType": "geometry",
              "stylers": [
                { "visibility": "on" },
                { "color": ""+buildColor+"" }
              ]
            },
					{
					 "featureType": "road",
					 "elementType": "geometry.stroke",
					 "stylers": [
						{ "color": ""+roadBorder+"" }
					 ]
				  	},
					{
					 "featureType": "road",
					 "elementType": "labels",
					 "stylers": [
						{ "color": "#000" },
      				{ "invert_lightness": "true" }
					 ]
				  	},
					{
						"elementType": "labels.text.stroke",
						"stylers": [
						{ "visibility": "off" }
					  ]
					},
					{
						"elementType": "labels.text",
						"stylers": [
						{ "color": ""+fontColor+"" }
						]
					}
				]
		};

		map = new google.maps.Map(document.getElementById(id), options);
  	
  	// Verifica se a opção do marcador foi escolhida, 
  	if(pointer === true){
      var marker = new google.maps.Marker({
          position: latlng,
          title: ""+mapName+"",
          map: map
      });
      
     // Cria uma infobox
  	if(info === true){
      var infobox = new InfoBox({
        content: ""+mapName+"",
        disableAutoPan: false,
        maxWidth: 150,
        pixelOffset: new google.maps.Size(0, 0),
        zIndex: null,
        boxStyle: {
          width: "200px",
          color: "#840000",
          textAlign: "center",
          fontWeight: "800",
          marginLeft: "-90px",
          marginTop: "15px"
        },
        infoBoxClearance: new google.maps.Size(1, 1)
    	});
      $(".gm-style-iw").next("div").hide();
      infobox.open(map, marker);
    }
    }
}

googleMaps("mapa");
              
            
!
999px

Console