Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/07/2012, 11:21
Avatar de vero00809_chinita
vero00809_chinita
 
Fecha de Ingreso: mayo-2012
Mensajes: 21
Antigüedad: 12 años, 5 meses
Puntos: 0
Google Maps, mostrar infoWindow como hacerlo

hola buenas tardes miren tengo una duda en que parte del código podría agregar la información de ya q quiero ahí colocar la dirección que se esta marcando en el marker
aquí les dejo le código alguien podría ayudarme por favor


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>


<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>

<style type="text/css">
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0px;
padding: 0px;

}

#control {
background: #fff;
padding: 5px;
font-size: 14px;
font-family: Arial;
border: 1px solid #ccc;
box-shadow: 0 2px 2px rgba(33, 33, 33, 0.4);
display: none;
}
#map_canvas
{
margin-right: 400px;
height: 80%;
}
#directions-panel
{
height : 100%;
float :right ;
width : 390 px;
overflow :auto;
}
@media print
{

#map_cavas
{
height :500 px;
margin : 0;
}
#directions-panel
{
float : none;
width :auto;
}
}
</style>

<script type="text/javascript">

function initialize() {
var myOptions = {
zoom: 10,
center: new google.maps.LatLng(-33.9, 151.2),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canva s"),
myOptions);

setMarkers(map, beaches);
}


var beaches = [
['Bondi Beach', -33.890542, 151.274856, 4],
['Coogee Beach', -33.923036, 151.259052, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];

function setMarkers(map, locations) {

var image = new google.maps.MarkerImage('../images/11.png',

new google.maps.Size(20, 32),

new google.maps.Point(0, 0),

new google.maps.Point(0, 32));
var shadow = new google.maps.MarkerImage('../images/11.png',

new google.maps.Size(37, 32),
new google.maps.Point(0, 0),
new google.maps.Point(0, 32));

var shape = {
coord: [1, 1, 1, 20, 18, 20, 18, 1],
type: 'poly'
};
for (var i = 0; i < locations.length; i++) {
var beach = locations[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadow,
icon: image,
shape: shape,
title: beach[0],
zIndex: beach[3]
});
}
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>