public void onMarkerSelect(OverlaySelectEvent event) {
    Marker marker = (Marker) event.getOverlay();

    FacesContext.getCurrentInstance()
        .addMessage(
            null,
            new FacesMessage(FacesMessage.SEVERITY_INFO, "Marker Selected", marker.getTitle()));
  }
 public void onMarkerDrag(MarkerDragEvent event) {
   Marker marker = event.getMarker();
   addMessage(
       new FacesMessage(
           FacesMessage.SEVERITY_INFO,
           "Marca trasladada",
           "Lat:" + marker.getLatlng().getLat() + ", Lng:" + marker.getLatlng().getLng()));
 }
 public void addMarker(ActionEvent actionEvent) {
   Marker marker = new Marker(new LatLng(lat, lng), title);
   marker.setDraggable(true);
   draggableModel.addOverlay(marker);
   addMessage(
       new FacesMessage(
           FacesMessage.SEVERITY_INFO, "Marca agregada", "Lat:" + lat + ", Lng:" + lng));
   for (Marker marker1 : draggableModel.getMarkers()) {
     marker1.setDraggable(true);
   }
 }
  /** Initializes the map */
  @PostConstruct
  private void init() {
    map = new DefaultMapModel();

    LatLng coord = new LatLng(baseStationBean.getLatitude(), baseStationBean.getLongitude());

    Marker marker = new Marker(coord);
    marker.setDraggable(true);

    map.addOverlay(marker);
  }
  public StartStationMapBean() {
    draggableModel = new DefaultMapModel();

    // Shared coordinates
    LatLng coord1 = new LatLng(50.784361, 6.053046);
    LatLng coord2 = new LatLng(51.214619, 6.792017);

    // Draggable
    draggableModel.addOverlay(new Marker(coord1, "Aachen, Kastanienweg 13"));
    draggableModel.addOverlay(new Marker(coord2, "Düsseldorf"));

    for (Marker marker : draggableModel.getMarkers()) {
      marker.setDraggable(true);
    }
  }
  /** @param event the marker dragged */
  public void onMarkerDrag(MarkerDragEvent event) {
    selectedMarker = event.getMarker();

    LatLng latLng = selectedMarker.getLatlng();

    baseStationBean.setLongitude(round(latLng.getLng(), 6));
    baseStationBean.setLatitude(round(latLng.getLat(), 6));
  }
  private List<Marker> createMarkersFromEvents(List<Event> events) {
    List<Marker> markers = new ArrayList<Marker>(events.size());
    for (Event event : events) {
      Location start = getLocationByType(event, LocationType.START);
      if (start != null) {
        Marker marker =
            new Marker(
                new LatLng(start.getPoint().getCoordinate().y, start.getPoint().getCoordinate().x));
        marker.setTitle(event.getName());
        marker.setData(event);
        if (event.getPublicEvent() != null && event.getPublicEvent().booleanValue()) {
          marker.setIcon("http://maps.google.com/mapfiles/ms/micons/green-dot.png");
        }

        markers.add(marker);
      }
    }

    return markers;
  }
  public void onMarkerSelect(OverlaySelectEvent event) {
    Marker marker = (Marker) event.getOverlay();

    addMessage(
        new FacesMessage(FacesMessage.SEVERITY_INFO, "Marca Seleccionada", marker.getTitle()));
  }