예제 #1
0
  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);
    }
  }
  public void filterChange() {

    this.filteredEvents = new ArrayList<Event>();
    EventFilter eventFilter = new EventFilter();

    logger.info("filter event");

    if (selectedOptions.size() == ALL_OPTIONS_SELECTED || selectedOptions.size() == 0) {

      this.filteredEvents = this.events;
    } else {

      for (String filter : selectedOptions) {

        if (filter.equals("past")) {
          this.filteredEvents.addAll((eventFilter.filterPastEvents(this.events)));

        } else if (filter.equals("upcoming")) {
          this.filteredEvents.addAll(eventFilter.filterUpcomingEvents(this.events));

        } else {
          this.filteredEvents.addAll(eventFilter.filterActiveEvents(this.events));
        }
      }
    }

    List<Marker> markers = createMarkersFromEvents(this.filteredEvents);
    mapModel.getMarkers().clear();
    for (Marker marker : markers) {
      mapModel.addOverlay(marker);
    }
  }
예제 #3
0
 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);
   }
 }
예제 #4
0
  /** 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);
  }
예제 #5
0
 public void addRequirement() {
   Marker marker = new Marker(new LatLng(lat, lng), description);
   emptyModel.addOverlay(marker);
   FacesContext.getCurrentInstance()
       .addMessage(
           null,
           new FacesMessage(
               FacesMessage.SEVERITY_INFO,
               "Requirenment Added",
               "types:" + aptTypes + "Min:" + minCost + "Max:" + maxCost + "Lat:" + lat + ", Lng:"
                   + lng));
 }
예제 #6
0
파일: MapBean.java 프로젝트: pdhssp/ho
  public MapBean() {
    polygonModel = new DefaultMapModel();

    // Shared coordinates
    LatLng coord1 = new LatLng(36.879466, 30.667648);
    LatLng coord2 = new LatLng(36.883707, 30.689216);
    LatLng coord3 = new LatLng(36.879703, 30.706707);

    // Polygon
    Polygon polygon = new Polygon();
    polygon.getPaths().add(coord1);
    polygon.getPaths().add(coord2);
    polygon.getPaths().add(coord3);

    polygon.setStrokeColor("#FF9900");
    polygon.setFillColor("#FF9900");
    polygon.setStrokeOpacity(0.7);
    polygon.setFillOpacity(0.7);

    polygonModel.addOverlay(polygon);

    // Shared coordinates
    coord1 = new LatLng(36.877466, 30.666648);
    coord2 = new LatLng(36.884707, 30.688216);
    coord3 = new LatLng(36.873703, 30.705707);

    // Polygon
    polygon = new Polygon();
    polygon.getPaths().add(coord1);
    polygon.getPaths().add(coord2);
    polygon.getPaths().add(coord3);

    polygon.setStrokeColor("#FF9700");
    polygon.setFillColor("#FF9600");
    polygon.setStrokeOpacity(0.8);
    polygon.setFillOpacity(0.9);

    polygonModel.addOverlay(polygon);
  }
  @PostConstruct
  private void init() {
    mapModel = new DefaultMapModel();
    this.events = eventDAO.findAllByOwner(signedMember);
    this.filteredEvents = events;

    List<Marker> markers = createMarkersFromEvents(this.filteredEvents);
    for (Marker marker : markers) {
      mapModel.addOverlay(marker);
    }

    generateMapParams();
  }
예제 #8
0
  @PostConstruct
  public void init() {

    circleModel = new DefaultMapModel();

    // Shared coordinates
    LatLng coord1 = new LatLng(36.879466, 30.667648);
    LatLng coord4 = new LatLng(36.885233, 30.702323);

    // Circle
    Circle circle1 = new Circle(coord1, 500);
    circle1.setStrokeColor("#d93c3c");
    circle1.setFillColor("#d93c3c");
    circle1.setFillOpacity(0.5);

    Circle circle2 = new Circle(coord4, 300);
    circle2.setStrokeColor("#00ff00");
    circle2.setFillColor("#00ff00");
    circle2.setStrokeOpacity(0.7);
    circle2.setFillOpacity(0.7);

    circleModel.addOverlay(circle1);
    circleModel.addOverlay(circle2);
  }