Package org.zkoss.openlayers.geometry

Examples of org.zkoss.openlayers.geometry.Point


            pair("style", layer_style),
            pair("renderers",
                new Object[] { "SVG", "VML", "Canvas" })));

    // create a point feature
    Point point = new Point(-111.04, 45.68);
    Vector pointFeature = new Vector(point, null, style_blue);
    Point point2 = new Point(-105.04, 49.68);
    Vector pointFeature2 = new Vector(point2, null, style_green);
    Point point3 = new Point(-105.04, 49.68);
    Vector pointFeature3 = new Vector(point3, null, style_mark);

    // create a line feature from a list of points
    List<Point> pointList = new ArrayList<Point>();
    Point newPoint = point;
    for (int p = 0; p < 15; ++p) {
      newPoint = new Point(newPoint.getX() + Math.random(),
          newPoint.getY() + Math.random());
      pointList.add(newPoint);
    }

    Vector lineFeature = new Vector(new LineString(pointList), null,
        style_green);

    // create a polygon feature from a linear ring of points
    List<Point> point2List = new ArrayList<Point>();
    for (int p = 0; p < 6; ++p) {
      double a = p * (2 * Math.PI) / 7;
      double r = Math.random() + 1;
      Point newPoint1 = new Point(point.getX() + (r * Math.cos(a)),
          point.getY() + (r * Math.sin(a)));
      point2List.add(newPoint1);
    }
    point2List.add(point2List.get(0));

 
View Full Code Here


                        pair("labelYOffset",
                            "${yOffset}")))))),
            pair("renderers",
                new Object[] { "SVG", "VML", "Canvas" })));

    Point point = new Point(-111.04, 45.68);
    Feature pointFeature = new Vector(point, toMap(pair("name", "toto"),
        pair("age", 20), pair("favColor", "red"), pair("align", "cm")));

    // create a polygon feature from a linear ring of points
    List<Point> pointList = new ArrayList<Point>();
    for (int p = 0; p < 6; ++p) {
      double a = p * (2 * Math.PI) / 7;
      double r = Math.random() + 1;
      Point newPoint = new Point(point.getX() + 5 + (r * Math.cos(a)),
          point.getY() + 5 + (r * Math.sin(a)));
      pointList.add(newPoint);
    }

    pointList.add(pointList.get(0));

    LinearRing linearRing = new LinearRing(pointList);
    Vector polygonFeature = new Vector(new Polygon(
        Arrays.asList(linearRing)), toMap(pair("name", "dude"),
        pair("age", 21), pair("favColor", "purple"),
        pair("align", "lb")));

    Vector multiFeature = new Vector(new Collection(Arrays.asList(
        new LineString(Arrays.asList(new Point(-105, 40.0), new Point(
            -95, 45.0))), new Point(-105, 40))), toMap(
        pair("name", "ball-and-chain"), pair("age", 30),
        pair("favColor", "black"), pair("align", "rt")));

    // Create a point feature to show the label offset options
    Point labelOffsetPoint = new Point(-101.04, 35.68);
    Vector labelOffsetFeature = new Vector(labelOffsetPoint, toMap(
        pair("name", "offset"), pair("age", 22),
        pair("favColor", "blue"), pair("align", "cm"),
        // positive value moves the label to the right
        pair("xOffset", 50),
View Full Code Here

    return new Size(getWidth(), getHeight());
  }

  public Polygon toGeometry() {
    List<Point> points = cast(Arrays.asList(
        new Point(_left, _bottom), new Point(_right, _bottom),
        new Point(_right, _top), new Point(_left, _top)));
    return new Polygon(Arrays.asList(new LinearRing(points)));
  }
View Full Code Here

TOP

Related Classes of org.zkoss.openlayers.geometry.Point

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.