5 wrz 2008

Dodawanie wartości do selecta

function dodajCombo(sel, dane) {

  var tab_test = new Array();
  var nr = 0;

  sel.options[nr] = new Option("", "");
  nr++;

  cnt = dane.length;
  for (i = 0; i & lt; cnt; i++) {
    if (tab_test[dane[i].id] == undefined) {
      tab_test[dane[i].id] = dane[i].name;
      sel.options[nr] = new Option(dane[i].name, dane[i].id);
      nr++;
    }
  }
}
24 lip 2008

Wyświetlenie punktów z dymkami

var dane = new Array();
dane[0] = { lat: 52.224355732689, lng: 21.253480911255, dymek: '<span class="dymek"><b>opis</b></span>' }

var cnt = dane.length;
for (i = 0; i < cnt; i++) {
  var d = dane[i];
  var marker = new GMarker(new GPoint(d.lng, d.lat));
  map.addOverlay(marker);
  marker.openInfoWindowHtml(d.dymek);
}