Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created June 9, 2012 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yesidays/2899297 to your computer and use it in GitHub Desktop.
Save yesidays/2899297 to your computer and use it in GitHub Desktop.
Google Maps + Javascript
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; }
#map_canvas { margin: auto 0 auto 0; }
</style>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(21.897758,-102.299800);
var myOptions = {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
/* Agregar un Marcador */
var marker = new google.maps.Marker({
position: latlng,
map: map
});
/* Personalizar marcar */
var image = 'semaforo.png';
var myLatLng = new google.maps.LatLng(21.891758,-102.299800);
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:60%; height:60%"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment