<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!-- add some CSS styles to make the map fill the WebView -->
<style type="text/css">
html{
height:100%;
}
body, #map_canvas{
height:100%;
margin:0px;
padding:0px;
}
</style>
<!-- Reference to the map control -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
function initialize() {
var myLatlng = new google.maps.LatLng(36.7983331,-5.5708481);
// Centro del mapa en "LatLng"
var myOptions = {
zoom: 10,
// Nivel inicial de Zoom. Se puede utilizar desde 0 a 20
center: myLatlng,
mapTypeId: google.maps.MapTypeId.HYBRID
// Tipo de mapa
// HYBRID - displays a transparent layer of major streets on satellite images
// ROADMAP - displays a normal street map
// SATELLITE - displays satellite images
// TERRAIN - displays maps with physical features such as terrain
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var infowindow = new google.maps.InfoWindow();
// set the variable infowindow
// create a LatLngBounds object
var bounds=new google.maps.LatLngBounds();
//********************* Dibujo de PUERTO REAL ******************************
var Puerto_Real_marker = new google.maps.Marker
// set the variable marker
({
position: new google.maps.LatLng(36.5287811,-6.1923722),
// set the geographic position for the marker
map: map,
// puts the marker on the specified map
title: "Puerto Real",
// text that will display when the mouse cursor hovers over the marker
icon: 'puerto_real.gif'
// location of image file that will be used as a marker
});
google.maps.event.addListener
// Event addlistener for info window of marker
(
Puerto_Real_marker,
// associates the action with the marker named marker
'click',
// declares which event will trigger the event
// Valid values are as follows
// click, dblclick, mousedown, mousemove, mouseout, mouseover,mouseup, rightclick
function () {
infowindow.setContent('<font color=#FF00FF>Puerto Real, sol y pinos.</font>');
// sets the content for the info window (any valid html will do here
infowindow.open(map, Puerto_Real_marker);
// sets the info window to open based on the event
});
// extend the bounds object with the Puerto_Real_marker position
bounds.extend(Puerto_Real_marker.getPosition());
//****************************** Dibujo de Jerez de la Frontera *****************************
var Jerez_marker = new google.maps.Marker({
position: new google.maps.LatLng(36.682452,-6.1407201),
map: map,
title: "Jerez de la Frontera",
icon: 'jerez.gif'
});
google.maps.event.addListener(
Jerez_marker, 'click', function () {
infowindow.setContent('<font color=#FF00FF>Jerez, vinos y caballos.</font>');
infowindow.open(map, Jerez_marker);
});
// extend the bounds object with the Jerez_marker position
bounds.extend(Jerez_marker.getPosition());
// fit the map to the markers
map.fitBounds(bounds);
//********************* Poner las marcas ******************************************
}
</script>
</head>
<title>Basic Google Map with an Image Marker v3</title>
<body bgcolor="#FFFFFF" onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>