Package org.primefaces.model.map

Examples of org.primefaces.model.map.LatLng


    } else if(params.containsKey(clientId + "_markerDragged")) {
      String id = params.get(clientId + "_markerId");
      Marker marker = (Marker) model.findOverlay(id);
      double lat = Double.valueOf(params.get(clientId + "_lat"));
      double lng = Double.valueOf(params.get(clientId + "_lng"));
      marker.setLatlng(new LatLng(lat, lng));
     
      map.queueEvent(new MarkerDragEvent(map, marker));
     
    } else if(params.containsKey(clientId + "_stateChanged")) {
      String[] centerLoc = params.get(clientId + "_center").split(",");
      String[] northeastLoc = params.get(clientId + "_northeast").split(",");
      String[] southwestLoc = params.get(clientId + "_southwest").split(",");
      int zoomLevel = Integer.valueOf(params.get(clientId + "_zoom"));
     
      LatLng center = new LatLng(Double.valueOf(centerLoc[0]), Double.valueOf(centerLoc[1]));
      LatLng northeast = new LatLng(Double.valueOf(northeastLoc[0]), Double.valueOf(northeastLoc[1]));
      LatLng southwest = new LatLng(Double.valueOf(southwestLoc[0]), Double.valueOf(southwestLoc[1]));
     
      map.queueEvent(new StateChangeEvent(map, new LatLngBounds(center, northeast, southwest), zoomLevel));
     
    } else if(params.containsKey(clientId + "_pointSelected")) {
      String[] latlng = params.get(clientId + "_pointLatLng").split(",");
      LatLng position = new LatLng(Double.valueOf(latlng[0]), Double.valueOf(latlng[1]));
     
      map.queueEvent(new PointSelectEvent(map, position));
    }
  }
View Full Code Here


  protected void encodePaths(FacesContext facesContext, List<LatLng> paths) throws IOException {
    ResponseWriter writer = facesContext.getResponseWriter();
   
    writer.write(",path:[");
    for(Iterator<LatLng> coords = paths.iterator(); coords.hasNext();) {
      LatLng coord = coords.next();
     
      writer.write("new google.maps.LatLng(" + coord.getLat() + ", " + coord.getLng() + ")");
     
      if(coords.hasNext())
        writer.write(",");
     
    }
View Full Code Here

      return stopItems;
    }

    public String getMapPosition() {
      LatLng position = getMapData().getMarkers().get(0).getLatlng();
      return (position.getLat() + 0.025) + ","
          + (position.getLng() - 0.05);

    }
View Full Code Here

      Rectangle rectangle = (Rectangle) rectangles.next();
     
      writer.write("new google.maps.Rectangle({");
      writer.write("id:'" + rectangle.getId() + "'");
     
            LatLng ne = rectangle.getBounds().getNorthEast();
            LatLng sw = rectangle.getBounds().getSouthWest();
                       
      writer.write(",bounds:new google.maps.LatLngBounds( new google.maps.LatLng(" + ne.getLat() + "," + ne.getLng() +"), new google.maps.LatLng(" + sw.getLat() + "," + sw.getLng() +"))");
     
      writer.write(",strokeOpacity:" + rectangle.getStrokeOpacity());
      writer.write(",strokeWeight:" + rectangle.getStrokeWeight());
      writer.write(",fillOpacity:" + rectangle.getFillOpacity());
     
View Full Code Here

  protected void encodePaths(FacesContext context, List<LatLng> paths) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
   
    writer.write(",path:[");
    for(Iterator<LatLng> coords = paths.iterator(); coords.hasNext();) {
      LatLng coord = coords.next();
     
      writer.write("new google.maps.LatLng(" + coord.getLat() + ", " + coord.getLng() + ")");
     
      if(coords.hasNext())
        writer.write(",");
     
    }
View Full Code Here

      Rectangle rectangle = (Rectangle) rectangles.next();
     
      writer.write("new google.maps.Rectangle({");
      writer.write("id:'" + rectangle.getId() + "'");
     
            LatLng ne = rectangle.getBounds().getNorthEast();
            LatLng sw = rectangle.getBounds().getSouthWest();
                       
      writer.write(",bounds:new google.maps.LatLngBounds( new google.maps.LatLng(" + ne.getLat() + "," + ne.getLng() +"), new google.maps.LatLng(" + sw.getLat() + "," + sw.getLng() +"))");
     
      writer.write(",strokeOpacity:" + rectangle.getStrokeOpacity());
      writer.write(",strokeWeight:" + rectangle.getStrokeWeight());
      writer.write(",fillOpacity:" + rectangle.getFillOpacity());
     
View Full Code Here

  protected void encodePaths(FacesContext context, List<LatLng> paths) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
   
    writer.write(",path:[");
    for(Iterator<LatLng> coords = paths.iterator(); coords.hasNext();) {
      LatLng coord = coords.next();
     
      writer.write("new google.maps.LatLng(" + coord.getLat() + ", " + coord.getLng() + ")");
     
      if(coords.hasNext())
        writer.write(",");
     
    }
View Full Code Here

                String[] centerLoc = params.get(clientId + "_center").split(",");
                String[] northeastLoc = params.get(clientId + "_northeast").split(",");
                String[] southwestLoc = params.get(clientId + "_southwest").split(",");
                int zoomLevel = Integer.valueOf(params.get(clientId + "_zoom"));

                LatLng center = new LatLng(Double.valueOf(centerLoc[0]), Double.valueOf(centerLoc[1]));
                LatLng northeast = new LatLng(Double.valueOf(northeastLoc[0]), Double.valueOf(northeastLoc[1]));
                LatLng southwest = new LatLng(Double.valueOf(southwestLoc[0]), Double.valueOf(southwestLoc[1]));

                wrapperEvent = new StateChangeEvent(this, behaviorEvent.getBehavior(), new LatLngBounds(northeast, southwest), zoomLevel, center);
            }
            else if(eventName.equals("pointSelect")) {
                String[] latlng = params.get(clientId + "_pointLatLng").split(",");
                LatLng position = new LatLng(Double.valueOf(latlng[0]), Double.valueOf(latlng[1]));

                wrapperEvent = new PointSelectEvent(this, behaviorEvent.getBehavior(), position);
            }
            else if(eventName.equals("markerDrag")) {
                Marker marker = (Marker) this.getModel().findOverlay(params.get(clientId + "_markerId"));
                double lat = Double.valueOf(params.get(clientId + "_lat"));
                double lng = Double.valueOf(params.get(clientId + "_lng"));
                marker.setLatlng(new LatLng(lat, lng));

                wrapperEvent = new MarkerDragEvent(this, behaviorEvent.getBehavior(), marker);
            }
           
            wrapperEvent.setPhaseId(behaviorEvent.getPhaseId());
View Full Code Here

    public MapBean() { 
      System.out.println("Creando MapaBean...");
        simpleModel = new DefaultMapModel()
         
        //Shared coordinates 
        LatLng coord1 = new LatLng(-12.061276302138568,-77.04394340515137)
        /*LatLng coord2 = new LatLng(36.883707, 30.689216); 
        LatLng coord3 = new LatLng(36.879703, 30.706707); 
        LatLng coord4 = new LatLng(36.885233, 30.702323);  */
         
        //Basic marker 
View Full Code Here

TOP

Related Classes of org.primefaces.model.map.LatLng

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.