Foros del Web » Programando para Internet » Javascript »

Google maps: mapa se muestra en blanco

Estas en el tema de Google maps: mapa se muestra en blanco en el foro de Javascript en Foros del Web. Hola a todos, estoy usando el template AdminLET 2 y el framework Laravel 5.2.* pero un mapa que siempre funciona, ahora no lo esta haciendo ...
  #1 (permalink)  
Antiguo 08/11/2016, 16:24
 
Fecha de Ingreso: octubre-2008
Mensajes: 268
Antigüedad: 15 años, 6 meses
Puntos: 3
Google maps: mapa se muestra en blanco

Hola a todos, estoy usando el template AdminLET 2 y el framework Laravel 5.2.* pero un mapa que siempre funciona, ahora no lo esta haciendo se ve en gris, no se cual sea el problema, alguien tiene alguna idea

<script type="text/javascript" src="AQU VA EL API"></script>
<script type="text/javascript">
var map = null;
var infoWindow = null;

function initialize(address, latit, longi) {
var latitud;
var longitud;
var geoCoder = new google.maps.Geocoder(address)
var request = { address: address };

if(latit==0 && longi == 0){
latit = -12.046374;
longi = -77.0427934;
}else{
latit = latit;
longi = longi;
}

geoCoder.geocode(request, function (result, status) {
// var latlng = new google.maps.LatLng(result[0].geometry.location.lat(), result[0].geometry.location.lng());
var myOptions = {
zoom: 11,
center: {lat: latit, lng: longi},
mapTypeId: google.maps.MapTypeId.ROADMAP
};

map = new google.maps.Map(document.getElementById("mapa"), myOptions);
infoWindow = new google.maps.InfoWindow();

var marker = new google.maps.Marker({
position: {lat: latit, lng: longi},
draggable: true,
map: map
});

google.maps.event.addListener(marker, 'mouseup', function () {
openInfoWindow(marker, address);

$('#TxtLatitud').val(marker.getPosition().lat());
$('#TxtLongitud').val(marker.getPosition().lng());
});
})
}

function openInfoWindow(marker, direccion) {
var markerLatLng = marker.getPosition();
infoWindow.setContent([
'<P>Mi Direcci&oacute;n: ', direccion, '.</P>'
].join(''));
infoWindow.open(map, marker);
}

initialize('AV. GRANADOS 2398','-12.020183252','-77.099784977');
</script>

<div id="mapa" name="mapa" class="mapa" style="width: 100%; height: 343px; "> </div>

Última edición por ragde23fer; 08/11/2016 a las 16:39
  #2 (permalink)  
Antiguo 17/11/2016, 09:47
 
Fecha de Ingreso: octubre-2008
Mensajes: 268
Antigüedad: 15 años, 6 meses
Puntos: 3
Respuesta: Google maps: mapa se muestra en blanco

Nadie sabe???

Etiquetas: blanco, funcion, google, js, mapa, maps, muestra, text
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:55.