Hola,
No consigo controlar el zoom de mi mapa utilizando javascript.
Tengo un fichero KML con las localizaciones y quiero mostrarlo en una ventana web. Asigno un zoom de 2 pero no me lo reconoce .
Os dejo el codigo por si alguien puede ayudarme:
==================================================
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<title>KML Layers</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map" style="width:100%;height:100%"></div>
<script>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: {lat: 1.1062304, lng: 41.1551798, zoom: 15 }
});
var ctaLayer = new google.maps.KmlLayer({
url: 'http://karatereus.tk/mapa.php',
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=apiKey&callback=initMap">
</script>
</body>
</html>===============================================================
Muchas gracias por adelantado
Saludos