コード例 #1
0
  public void setMarcador(Aulas aula) {
    String cx = String.valueOf(aula.getCoordenadaX());
    String cy = String.valueOf(aula.getCoordenadaY());
    String contenido = aula.getContenido();

    if (cx != null && cy != null && contenido != null) {
      browser.executeJavaScript(
          "var marker;"
              + "        marker = new google.maps.Marker({"
              + "          position: new google.maps.LatLng("
              + cx
              + ", "
              + cy
              + "),"
              + "          map: map"
              + "    });"
              + "     google.maps.event.addListener(marker, 'click', (function(marker) {"
              + "       return function() {"
              + "        map.setZoom(32);"
              + "        map.setCenter(marker.getPosition());"
              + "        infowindow.setContent(\""
              + contenido
              + "\");"
              + "        infowindow.open(map, marker);"
              + "      }"
              + "    })(marker));");
    }
  }
コード例 #2
0
  public ArrayList<Aulas> importarDatos() throws ClassNotFoundException, SQLException {
    ArrayList<Aulas> listAulas = new ArrayList<>();
    ResultSet rs = consultarDatos();

    while (rs.next()) {
      Aulas aula = new Aulas();
      aula.setId(rs.getInt(1));
      aula.setEdificio(rs.getString(2));
      aula.setPiso(rs.getString(3));
      aula.setCoordenadaX(rs.getDouble(4));
      aula.setCoordenadaY(rs.getDouble(5));
      aula.setContenido(rs.getString(6));
      listAulas.add(aula);
    }
    return listAulas;
  }