Ver Mensaje Individual
  #9 (permalink)  
Antiguo 03/04/2011, 14:11
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: Clausura (clousure) y/o Encapsulación

Mal rayo parte es verdad se me olvida que existe this, bueno en ciertas ocaciones se me olvida

Lo digo porque en otros lados lo menciono y se me olvidó que lo puedo aplicar al objeto que se está creando en ese momento

Aquí está todo y con HUMACAO
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4.     <title>test</title>
  5.     <style>
  6.     *{ margin: 0; padding: 0; }
  7.     html, body, #map{
  8.         width: 100%;
  9.         height: 100%;
  10.     }
  11.     </style>
  12.     <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&amp;language=es"></script>
  13.     <script type="text/javascript">
  14.     window.onload = function(){
  15.         var options = {
  16.             zoom: 9
  17.             , center: new google.maps.LatLng(18.2, -66.4)
  18.             , mapTypeId: google.maps.MapTypeId.ROADMAP
  19.         };
  20.  
  21.         var map = new google.maps.Map(document.getElementById('map'), options);
  22.  
  23.         var place = new Array();
  24.         place['San Juan'] = new google.maps.LatLng(18.465, -66.105);
  25.         place['Mayagüez'] = new google.maps.LatLng(18.215, -67.14);
  26.         place['Ponce'] = new google.maps.LatLng(18.025, -66.615);
  27.         place['Fajardo'] = new google.maps.LatLng(18.336, -65.65);
  28.         place['Culebras'] = new google.maps.LatLng(18.315, -65.3);
  29.         place['Vieques'] = new google.maps.LatLng(18.125, -65.44);
  30.         place['Humacao'] = new google.maps.LatLng(18.14, -65.88);
  31.  
  32.         for(var i in place){
  33.             var marker = new google.maps.Marker({
  34.                 position: place[i]
  35.                 , map: map
  36.                 , title: i
  37.             });
  38.  
  39.             google.maps.event.addListener(marker, 'click', function(){
  40.                 var popup = new google.maps.InfoWindow();
  41.                 popup.setContent('Lugar: ' + this.title);
  42.                 popup.open(map, this);
  43.             })
  44.         }
  45.     };
  46.     </script>
  47. </head>
  48.     <div id="map"></div>
  49. </body>
  50. </html>
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos

Última edición por abimaelrc; 03/04/2011 a las 14:21