Package com.google.gwt.maps.client.overlay

Examples of com.google.gwt.maps.client.overlay.Polygon


            "BBBBB", 1);
        polylines[1].setColor("#ff0000");
        polylines[1].setWeight(2);
        polylines[1].setOpacity(0.7);

        Polygon theFountain = Polygon.fromEncoded(polylines, true, "#ff0000",
            0.2, true);
        map.addOverlay(theFountain);
      }
        break;
View Full Code Here


  private void createPolygon() {
    PolyStyleOptions style = PolyStyleOptions.newInstance(color, weight,
        opacity);

    final Polygon poly = new Polygon(new LatLng[0], color, weight, opacity,
        color, fillFlag ? .7 : 0.0);
    lastPolygon = poly;
    map.addOverlay(poly);
    poly.setDrawingEnabled();
    poly.setStrokeStyle(style);
    message2.setText("");
    poly.addPolygonLineUpdatedHandler(new PolygonLineUpdatedHandler() {

      public void onUpdate(PolygonLineUpdatedEvent event) {
        message2.setText(message2.getText() + " : Polygon Updated");
      }
    });

    poly.addPolygonCancelLineHandler(new PolygonCancelLineHandler() {

      public void onCancel(PolygonCancelLineEvent event) {
        message2.setText(message2.getText() + " : Polygon Cancelled");
      }
    });

    poly.addPolygonEndLineHandler(new PolygonEndLineHandler() {

      public void onEnd(PolygonEndLineEvent event) {
        message2.setText(message2.getText() + " : Polygon End at "
            + event.getLatLng() + ".  Bounds="
            + poly.getBounds().getNorthEast() + ","
            + poly.getBounds().getSouthWest() + " area=" + poly.getArea() + "m");
      }
    });
  }
View Full Code Here

  @Override
  public void onShow() {
    map.addOverlay(marker);
    if (firstTime) {
      computeAtlantaTriangle();
      polygon = new Polygon(ATLANTA_TRIANGLE1);
      polyline = new Polyline(ATLANTA_TRIANGLE2);
      firstTime = false;
    }
  }
View Full Code Here

      points[i] = LatLng.newInstance(currentLatLng.getLatitude()
          + Math.cos(angle) * distanceFactor, currentLatLng.getLongitude()
          + Math.sin(angle) * distanceFactor);
    }

    viewPolygon = new Polygon(points, "blue", 1, 0.5, "blue", 0.15);
    map.addOverlay(viewPolygon);
  }
View Full Code Here

    double opacity = polyUIDL.getDoubleAttribute("opacity");
    String fillColor = polyUIDL.getStringAttribute("fillcolor");
    double fillOpacity = polyUIDL.getDoubleAttribute("fillopacity");
    boolean clickable = polyUIDL.getBooleanAttribute("clickable");

    return new Polygon(points, color, weight, opacity, fillColor,
        fillOpacity, PolygonOptions.newInstance(clickable));
  }
View Full Code Here

      circlePoints[i] = point;
      bounds.extend(point);
      a += step;
    }

    Polygon circle = new Polygon(circlePoints, "green", 0, 0, "#00800", 0.5);
    oldCircle = circle;
  }
View Full Code Here

      LatLng.newInstance(bounds.getNeLat(), bounds.getSwLon()),
      LatLng.newInstance(bounds.getNeLat(), bounds.getNeLon())
    };

    // CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE.
    polygon = new Polygon(polyPoints, "#ff0000", 1, .75, "#3333cc", .25);
    return polygon;
  }
View Full Code Here

        LatLng.newInstance(sw.getLatitude(), ne.getLongitude()),
        sw,
        LatLng.newInstance(ne.getLatitude(), sw.getLongitude())
    };

    frozenBounds = new Polygon(polyPoints, "#0000FF", 3, .75, "#3333cc", 0);
    map.addOverlay(frozenBounds);
    updateToken();
  }
View Full Code Here

      double maxTime = model.getMaxTime();

      for (TimedPolygon tp : model.getPolygons()) {

        Polygon poly = tp.getPolyline();

        String color = getColorForTime(tp.getTime(), maxTime);
        double opacity = getOpacityForTime(tp.getTime(), maxTime);

        poly.setFillStyle(PolyStyleOptions.newInstance(color, 1, opacity));
        poly.setStrokeStyle(PolyStyleOptions.newInstance(color, 1, opacity));

        _mapOverlayManager.addOverlay(poly);
        _overlays.add(poly);
        LatLngBounds b = poly.getBounds();
        bounds.extend(b.getNorthEast());
        bounds.extend(b.getSouthWest());
      }

      if (!bounds.isEmpty()) {
View Full Code Here

      int time = times.get(i);
      _minTime = Math.min(time, _minTime);
      _maxTime = Math.max(time, _maxTime);

      Polygon poly = Polygon.fromEncoded(lines, true, "#0000FF", 0.1, true);
      TimedPolygon tp = new TimedPolygon(poly, time);
      _polygons.add(tp);

    }
View Full Code Here

TOP

Related Classes of com.google.gwt.maps.client.overlay.Polygon

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.