exibição do mapa de forma simples / Artigo: API Google Maps V3 - blog.thulioph.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initialize() { | |
// Exibir mapa; | |
var myLatlng = new google.maps.LatLng(-8.0631495, -34.87131120000004); | |
var mapOptions = { | |
zoom: 17, | |
center: myLatlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
} | |
// Exibir o mapa na div #mapa; | |
var map = new google.maps.Map(document.getElementById("mapa"), mapOptions); | |
} | |
// Função para carregamento assíncrono | |
function loadScript() { | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "http://maps.googleapis.com/maps/api/js?key=AIzaSyDeHb17So0QupSGO_d6b8X-OyvJ32UQehs&sensor=true&callback=initialize"; | |
document.body.appendChild(script); | |
} | |
window.onload = loadScript; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Opa! no bloco
Não deveria ter um ponto e vírgula no final?