Hola,

Estoy haciendo pruebas con la API de google maps y no me deja aƱadir
mas de 10 puntos. El resto me da error.

Os pego el codigo puede ser

function loadScript() {

   var script = document.createElement("script");
   script.type = "text/javascript";
   alert(window.location.host)
     script.src = "http://maps.google.com/maps?
file=api&v=2.x&key=MYKEY&async=2&callback=loadMap";
 document.body.appendChild(script);
 document.getElementById("view:_id1:datos").style.visibility='hidden';

}
function loadMap() {

        map = new GMap2(document.getElementById("view:_id1:map"));
   //   map.setMapType(G_SATELLITE_MAP);
        //para centrar el mapa en la guia
        var tb=document.getElementById("view:_id1:viewPanel1");
        var tr=tb.getElementsByTagName("tr");
        var td=tr[1].getElementsByTagName("td");
    var sp=td[3].getElementsByTagName("span");
    var cord=sp[0].firstChild.data.split(",")

    map.setCenter(new GLatLng(cord[0],cord[1]), 11);
   //map.setCenter(new GLatLng(43.322275,-3.013481), 12);
        map.setUIToDefault();
        mapMe();

   }

function mapMe() {
var tb=document.getElementById("view:_id1:viewPanel1");
var tr=tb.getElementsByTagName("tr");
map,nombre[0].firstChild.data,telefono[0].firstChild.data,direccion[0].firstChild.data,web[0].firstChild.data,email[0].firstChild.data,actividad[0].firstChild.data);
  showAddressInfo("43.353409,-3.009632", map);
  showAddressInfo("43.36263,-3.012314", map);
  showAddressInfo("43.327941,-3.012035", map);
  showAddressInfo("43.328924,-3.001842", map);
  showAddressInfo("43.343002,-3.000448", map);
  showAddressInfo("43.326278,-3.012491", map);
  showAddressInfo("43.352021,-3.007679", map);
  showAddressInfo("43.353987,-3.007143", map);
  showAddressInfo("43.378368,-2.958391", map);
  showAddressInfo("43.325381,-3.008709", map);
  showAddressInfo("43.380739,-2.980921", map);
  showAddressInfo("43.261472,-2.934058", map);
}

  function showAddress(address,
m,nombre,telefono,direccion,web,email,actividad) {

      var geocoder = new GClientGeocoder();
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
           alert(address + " not found");
          } else {

            var marker = new GMarker(point);
            m.addOverlay(marker);
                var html = "<b>"+nombre+"</b>"+"<br>Actividad:
"+actividad+"<br>Tlf: "+telefono+"<br>"+direccion+"<br><a
href=http://"+web+";>"+web+"</a><br><a href=\"mailto:"+email+"\";>"+email
+"</a>";
              GEvent.addListener(marker, "click", function()
{marker.openInfoWindowHtml(html);})

          }
        }
      );
    }

  function showAddressInfo(address, m) {
      var geocoder = new GClientGeocoder();
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
           alert(address + " not found");
          } else {

            var marker = new GMarker(point);
            m.addOverlay(marker);
                var html = address;
              GEvent.addListener(marker, "click", function() {
             marker.openInfoWindowHtml(html);
              })
            marker.openInfoWindowHtml(address);
          }
        }
      )
    }

dojo.addOnLoad(loadScript);

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to