示例#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));");
    }
  }