Package com.google.gwt.maps.client.geom

Examples of com.google.gwt.maps.client.geom.LatLng


         
          // make a back up and store it for a single level of Undo (via CancelRoadEvent)
          //backupEditPolyline = createBackUpPolyline(currentPolyline);
         
          // now send the currentPolyline back to RoadListing (via a copy)
          LatLng points[] = new LatLng[currentPolyline.getVertexCount()];
            for (int i = 0; i < currentPolyline.getVertexCount(); i++) {
              LatLng v = currentPolyline.getVertex(i);
              LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
              points[i] = p;
            }
              final TagPolyline p = new TagPolyline(points);
              p.setRoadDetailsId(currentPolyline.getRoadDetailsId());
              eventBus.fireEvent(new SentUpdatedPolylineEvent(p));
      } else {
        polyline.setEditingEnabled(false);
      }
    }
View Full Code Here


    private TagPolyline createBackUpPolyline(TagPolyline polyline) {
        LatLng[] points = new LatLng[polyline.getVertexCount()];
      int count = 0;
      for (int i = 0; i < polyline.getVertexCount(); i++) {
        LatLng o = polyline.getVertex(i);
        LatLng n = LatLng.newInstance(o.getLatitude(), o.getLongitude());
        points[i] = n;
      }
      TagPolyline newPoly = new TagPolyline(points, polylineColor, weight, opacity);
      return newPoly;
    }
View Full Code Here

            currentPolyline = polyline;
            GWT.log("hashCode: currentPolyline=" + currentPolyline.hashCode());
            GWT.log("hashCode: polyline=" + polyline.hashCode());
           
            //Window.alert("TagMap: PolylineEndLineHandler currentPolyline getVertexCount=" + currentPolyline.getVertexCount());
            LatLng points[] = new LatLng[currentPolyline.getVertexCount()];
            for (int i = 0; i < currentPolyline.getVertexCount(); i++) {
              LatLng v = currentPolyline.getVertex(i);
              LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
              points[i] = p;
            }
              final TagPolyline p = new TagPolyline(points);
              p.setRoadDetailsId(currentPolyline.getRoadDetailsId());
             
              // remove the temporary poly from the map
              /*
               * This is a workaround, and not a good one. It
               * removes the line from the map while the user
               * gives it a name, a tag, and clicks save.
               */
              //map.removeOverlay(polyline);
             
            eventBus.fireEvent(new EndEditPolyLineEvent(p));
          }
        })
       
    } else {
      /**
         * Send a copy of the TagPolyline to RoadListing
         */
      polyline.addPolylineLineUpdatedHandler(new PolylineLineUpdatedHandler() {
          public void onUpdate(PolylineLineUpdatedEvent event) {
            /*
             * If a line is being edited, it is the current line
             */
            currentPolyline = polyline;
           
            /*
             * Copy the currentPolyline into a new TagPolyline
             * in order to send it across the wire.
             */
            //Window.alert("TagMap: PolylineLineUpdatedEvent currentPolyline getVertexCount=" + currentPolyline.getVertexCount());
            LatLng points[] = new LatLng[currentPolyline.getVertexCount()];
            for (int i = 0; i < currentPolyline.getVertexCount(); i++) {
              LatLng v = currentPolyline.getVertex(i);
              LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
              points[i] = p;
            }
              final TagPolyline p = new TagPolyline(points);
              p.setRoadDetailsId(currentPolyline.getRoadDetailsId());
            eventBus.fireEvent(new BindPolyLineToRoadEvent(p));
          }
        });
     
      polyline.addPolylineCancelLineHandler(new PolylineCancelLineHandler() {
View Full Code Here

      polygon.addPolygonEndLineHandler(new PolygonEndLineHandler() {
          public void onEnd(PolygonEndLineEvent event) {
           
            currentPolygon = polygon;
           
            LatLng points[] = new LatLng[currentPolygon.getVertexCount()];
            for (int i = 0; i < currentPolygon.getVertexCount(); i++) {
              LatLng v = currentPolygon.getVertex(i);
              LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
              points[i] = p;
            }
              final TagPolygon p = new TagPolygon(points);
              p.setZoneDetailsId(currentPolygon.getZoneDetailsId());
              //Window.alert("Fire EndEditPolygonEvent with p=" + p);
            eventBus.fireEvent(new EndEditPolygonEvent(p));
          }
        })
    } else {
      /**
         * Send a copy of the TagPolygon to RoadListing
         */
      polygon.addPolygonLineUpdatedHandler(new PolygonLineUpdatedHandler() {
         
      public void onUpdate(PolygonLineUpdatedEvent event) {
            /*
             * If a shape is being edited, it is the current shape
             */
            currentPolygon = polygon;
           
            /*
             * Copy the currentPolygon into a new TagPolygon
             * in order to send it across the wire.
             */
            LatLng points[] = new LatLng[currentPolygon.getVertexCount()];
            for (int i = 0; i < currentPolygon.getVertexCount(); i++) {
              LatLng v = currentPolygon.getVertex(i);
              LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
              points[i] = p;
            }
              final TagPolygon p = new TagPolygon(points);
              p.setZoneDetailsId(currentPolygon.getZoneDetailsId());
              //Window.alert("Fire BindPolygonToZoneEvent with p=" + p);
            eventBus.fireEvent(new BindPolygonToZoneEvent(p));
          }
        });
     
View Full Code Here

    {
      LatLng[] points = new LatLng[vertices.size()];
      int count = 0;
      for (Iterator iterator = vertices.iterator(); iterator.hasNext();) {
        Vertex v = (Vertex) iterator.next();
        LatLng p = LatLng.newInstance(v.getLat(), v.getLng());
        points[count] = p;
        count++;
      }
      final TagPolygon polygon = new TagPolygon(points, polygonColor, weight, opacity, polygonColor, opacity);
      polygon.setZoneDetailsId(zoneDetailsId);
View Full Code Here

    {
      LatLng[] points = new LatLng[vertices.size()];
      int count = 0;
      for (Iterator iterator = vertices.iterator(); iterator.hasNext();) {
        Vertex v = (Vertex) iterator.next();
        LatLng p = LatLng.newInstance(v.getLat(), v.getLng());
        points[count] = p;
        count++;
      }
      final TagPolyline polyline = new TagPolyline(points, polylineColor, weight, opacity);
      polyline.setRoadDetailsId(roadDetailsId);
View Full Code Here

    public TagPolylineEndLineHandler(){}
   
    @Override
    public void onEnd(PolylineEndLineEvent event) {
      currentPolyline = (TagPolyline) event.getSender();
      LatLng points[] = new LatLng[currentPolyline.getVertexCount()];
      for (int i = 0; i < currentPolyline.getVertexCount(); i++) {
        LatLng v = currentPolyline.getVertex(i);
        LatLng p = LatLng.newInstance(v.getLatitude(), v.getLongitude());
        points[i] = p;
      }
           TagPolyline p = new TagPolyline(points);
           p.setRoadDetailsId(currentPolyline.getRoadDetailsId());
           eventBus.fireEvent(new EndEditPolyLineEvent(p));
    }
View Full Code Here

  {
    ArrayList<Vertex> vertices = new ArrayList<Vertex>();
    if( polygon != null)
    {
      for (int i = 0; i < polygon.getVertexCount(); i++) {
        LatLng latLng = polygon.getVertex(i);
        Vertex v = new Vertex();
        v.setLat(latLng.getLatitude());
        v.setLng(latLng.getLongitude());
        vertices.add(v);
      }
    } else {
      throw new Exception("Please draw a zone before saving zone details");
    }
View Full Code Here

      map.addOverlay(createMarker(locations.get(i)));
    }
  }

  private Marker createMarker(final Location loc) {
    LatLng latlng = LatLng.newInstance(loc.getLatitude(), loc.getLongitude());
    final Marker marker = new Marker(latlng);
    marker.addMarkerClickHandler(new MarkerClickHandler() {
      public void onClick(MarkerClickEvent event) {
        final InfoWindow info = map.getInfoWindow();
        info.open(marker, newLocationDescription(loc, info, marker));
View Full Code Here

    initWidget(panel);
  }

  public void addPartMarkers(int index, List<SearchResult> response) {
    LatLng searchLL = marker.getLatLng();
    map.clearOverlays();
    for (final SearchResult record : response) {

      LatLng ll = LatLng.newInstance(record.getLatitude(),
          record.getLongitude());
      Marker partMarker = new Marker(ll);
      map.addOverlay(partMarker);
      partMarker.setDraggingEnabled(false);
View Full Code Here

TOP

Related Classes of com.google.gwt.maps.client.geom.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.