Return to Snippet

Revision: 374
at November 24, 2007 07:47 by webDesign


Updated Code
***** JAVASCRIPT EN EL HEAD *****
// Conseguir la clave para el mapa en http://www.google.com/apis/maps/
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=AQUI VA LA CLAVE"></script>
    
<script type="text/javascript">	
//<![CDATA[
window.onload = mapasGoogle;
window.onunload= GUnload;

function mapasGoogle() {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("mapaGoogle"));	
	map.setCenter(new GLatLng(42.8475, -2.6820), 15); //Defino las coordenadas y nivel de zoom       	
	map.setMapType(G_HYBRID_TYPE); //Defino el tipo de mapa: hibrido
	map.addControl(new GSmallMapControl()); //Activo controles de movimiento y zoom del mapa
	map.addControl(new GMapTypeControl()); //Activo controles de tipo de mapa
	map.openInfoWindowHtml(map.getCenter(),
	("<img src='images/logo.png' width='20' height='20' style='float:left; margin-right:10px' alt='' /><em>Titulo</em> <br /> Lorem ipsum dolor sit amet"));
  }
}
//]]>
</script>

***** HTML *****
<div id="mapaGoogle" style="width:500px; height:400px"></div>

Revision: 373
at July 12, 2006 01:01 by webDesign


Initial Code
***** JAVASCRIPT EN EL HEAD *****
// Conseguir la clave para el mapa en http://www.google.com/apis/maps/
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=AQUI VA LA CLAVE"></script>
    
<script type="text/javascript">	
//<![CDATA[
window.onload = mapasGoogle;
window.onunload= GUnload;

function mapasGoogle() {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("mapaGoogle"));	
	map.setCenter(new GLatLng(42.8475, -2.6820), 15); //Defino las coordenadas y nivel de zoom       	
	map.setMapType(G_HYBRID_TYPE); //Defino el tipo de mapa: hibrido
	map.addControl(new GSmallMapControl()); //Activo controles de movimiento y zoom del mapa
	map.addControl(new GMapTypeControl()); //Activo controles de tipo de mapa
	map.openInfoWindowHtml(map.getCenter(),
	("<img src='images/logo.png' width='20' height='20' style='float:left; margin-right:10px' alt='' /><em>Titulo</em> <br /> Lorem ipsum dolor sit amet"));
  }
}
//]]>
</script>

***** HTML *****
<div id="mapaGoogle" style="width:500px; height:400px"></div>

Initial URL


Initial Description


Initial Title
Google Maps básico / Basic Google Map

Initial Tags
javascript, google

Initial Language
JavaScript