Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/07/2012, 17:27
Shikamaru_CSK
 
Fecha de Ingreso: abril-2008
Mensajes: 13
Antigüedad: 16 años, 1 mes
Puntos: 1
Respuesta: Problemas con centrado en Google Maps API

Gracias por responder, ya logré solucionarlo, tome una medida desesperada que después llevo a una medida decente.

Parece que si era un problema del las UI Tabs, lo que hice fue al seleccionar la tap correspondiente al mapa, volviera a inicializar el mapa, claro puse una bandera para que sólo lo haga la primera vez que cambia a la pestaña.

Por si te interesa, el iframe que llamo es como un plugin que hice en el cual le mando de parámetros el tamaño del mapa y las coordenadas del punto y es algo así:

Código PHP:
<?
    
if(isset($_GET["coordenadas"]) && $_GET["coordenadas"] != ""){
        
$coordenadas $_GET["coordenadas"];
        
$zoom "13";
    }else{
        
$coordenadas "23.257907,-100.810547";
        
$zoom "5";
    }
    
$width = (isset($_GET["width"])) ? $_GET["width"] : "600";
    
$height = (isset($_GET["height"])) ? $_GET["height"] : "300";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    <script src="jquery/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
    <script type="text/javascript">
        var map = null;
        var marker = null;
        var myLatlng = null;
        
         
        function initialize() {
            myLatlng = new google.maps.LatLng(<?=$coordenadas?>);
            var myOptions = {
              zoom: <?=$zoom?>,
              center: myLatlng,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            }
             map = new google.maps.Map($("#map").get(0), myOptions);
             marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                title: "Ubicaci&oacute;n de la Propiedad"
            });
        }
        $(document).ready(function() {
            initialize();
        });
    </script>

    <title>Seleccionar Coordenadas</title>
</head>
<body>
    <div id="map" valign="top" style="width:<?=$width?>px; height: <?=$height?>px; padding:10px 5px 15px 10px;"></div>
</body>
</html>
Pero pues ya logré solucionarlo como te dije, corriendo la función initialize cuando se pasa a esa pestaña.

Aun así, gracias por responder.

Nos estamos leyendo.