Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/02/2010, 10:01
moisesra
 
Fecha de Ingreso: noviembre-2007
Mensajes: 159
Antigüedad: 18 años, 10 meses
Puntos: 1
Respuesta: Pasar variables API GOOGLE MAPS

Ya he soluciona el problema, se puede ver aquí el resultado final:

http://www.maxomotor.com/php/gasolineras.php

lo que hice fue sacar la funcion que genera el mapa e integrarla en una nueva funcion que me permite pasarle las variables de latitud y longitud:

Código PHP:
    <script type="text/javascript">
    
jQuery(document).ready(function($) {
      $(
'a[rel*=facebox]').facebox();
      
    })
    function 
pasovariables(latitud, longitud){
      $(
document).bind('reveal.facebox', function() {
        if (
GBrowserIsCompatible()) {
            
//var latitud = 28.364819;
            //var longitud = -14.153137;
            
var map = new GMap2(document.getElementById("map_canvas"));
            
map.setCenter(new GLatLng(latitud, longitud), 16);
            
map.addControl(new GLargeMapControl());
            
map.addControl(new GMapTypeControl());
            
map.enableScrollWheelZoom();
            
//añado marcas
            
var icon = new GIcon();
             
icon.image = "/images/gasolinera.png";
               
icon.iconSize = new GSize(40, 63);
              
icon.iconAnchor = new GPoint(20, 63);
            
//sombra
            
icon.shadow = "/images/gasolinera_sombra.png";
            var 
tamanoSombra = new GSize(80,63);
            
icon.shadowSize = tamanoSombra; 
              var 
latlng = new GLatLng(latitud,longitud);
            
map.addOverlay(new GMarker(latlng, icon));
            

          }
      })
      }
    
</script> 
Saludos...
__________________
Mis proyectos:
-Anuncios Clasificados Gratis
-Anuncios del Motor en Canarias