Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/11/2010, 11:05
Avatar de BloodShadow
BloodShadow
 
Fecha de Ingreso: marzo-2010
Ubicación: El Salvador
Mensajes: 393
Antigüedad: 14 años, 1 mes
Puntos: 52
Respuesta: Como colocar el Google maps en coordenadas exactas ?

Hola, te dejo un ejemplo de uno que hice en php, si no entiendes algo me avisas

Código HTML:
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAATq9r8gftH8ebjQuPt8AWjhS7I1Gv0Gi28asr-SayES1gOB1C4xRjRXHJefLVcWpP5fv6l4gOvcDu5g" type="text/javascript"></script>
<script src="http://gmaps-utility-library.googlecode.com/svn/trunk/labeledmarker/release/src/labeledmarker_packed.js" type="text/javascript"></script>
<?
	$ubicaciones = catCategoryGet($actual->key, null, CAT_RECURSE_ALL, CAT_FETCH_ALL, languageInfos($categoryinfos + $metasinfos, $lang)) ;
?>

<script type="text/javascript">

	function load(){
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById('map'));
			//map.setMapType(G_DEFAULT_MAP_TYPES) ;
			var html = '<b>Direcci&oacute;n: </b><span style="display: block; width: 350px; height: 33px; overflow: hidden;"><?= $ubicaciones->direction ?></span><br /><b>Departamento: </b><?= $ubicaciones->department ?>.';

			var iconoMarca = new GIcon(G_DEFAULT_ICON) ;
			iconoMarca.image = "<?= $root ?>images/icono.png"; 
			
			var tamanoIcono = new GSize(49,43);
			iconoMarca.iconSize = tamanoIcono; 
			
			iconoMarca.iconAnchor = new GPoint(50, 20); 

			var marker = new GMarker(new GLatLng(<?= $ubicaciones->coords_x ?> , <?= $ubicaciones->coords_y ?>), iconoMarca); 

			map.setCenter(new GLatLng(<?= $ubicaciones->coords_x ?> , <?= $ubicaciones->coords_y ?>), 17);
			map.addControl(new GSmallMapControl());
			map.addOverlay(marker);
			marker.openInfoWindowHtml(html);
		}
	}
</script>
<div id="map" style="text-align: left; width: <?= $ubicaciones->width ?>px; height: <?= $ubicaciones->height ?>px"></div> 
Ando corto de tiempo, asi que si no lo entiendes me avisas, en resumen solo agrega las coordenadas donde yo estoy usando el objeto <?= $ubicaciones->coords_x ?> y <?= $ubicaciones->coords_y ?>

Cualquier cosa me avisas... Suerte