Examples of Coordinate


Examples of org.geomajas.geometry.Coordinate

   * @param imageSrc src of the marker image
   * @param width width of the marker image
   * @param height height of the marker image
   */
  public void addMarker(String id, double lat, double lon, String imageSrc, int width, int height) {
    registerWorldPaintable(new Marker(id, imageSrc, GeoUtil.convertToGoogle(new Coordinate(lat, lon)), width,
        height));
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

    obj.setFeatureIncludes(GeomajasConstant.FEATURE_INCLUDE_GEOMETRY);
    obj.setFilter("bla");
    obj.setLayerId("beans");
    obj.setPaintGeometries(true);
    obj.setPaintLabels(false);
    obj.setPanOrigin(new Coordinate(10, 20));
    obj.setRenderer("SVG");
    obj.setScale(2.5);
    NamedStyleInfo nsi = new NamedStyleInfo();
    nsi.setName("nsi");
    obj.setStyleInfo(nsi);
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

  public void testGetVectorTile() throws Exception {
    GetVectorTileRequest request = new GetVectorTileRequest();
    request.setCrs(CRS);
    request.setLayerId(LAYER_ID);
    request.setCode(new TileCode(0, 0, 0));
    request.setPanOrigin(new Coordinate(0, 0));
    request.setRenderer(GetVectorTileRequest.PARAM_SVG_RENDERER);
    request.setScale(1.0);
    GetVectorTileResponse response = (GetVectorTileResponse) dispatcher.execute(
        GetVectorTileRequest.COMMAND, request, null, "en");
    if (response.isError()) {
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

    Assert.assertNotNull(features);
    Assert.assertEquals(1, features.length);
    Assert.assertEquals("Country 3", features[0].getLabel());
    Geometry geometry = features[0].getGeometry();
    Assert.assertNotNull(geometry);
    Coordinate coor = geometry.getGeometries()[0].getGeometries()[0].getCoordinates()[0];
    Assert.assertEquals(-1, coor.getX(), DOUBLE_TOLERANCE);
    Assert.assertEquals(0, coor.getY(), DOUBLE_TOLERANCE);

    // try again using mercator
    request.setCrs("EPSG:900913");
    response = (SearchFeatureResponse) dispatcher.execute(SearchFeatureRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
    Assert.assertFalse(response.isError());
    Assert.assertEquals(LAYER_ID, response.getLayerId());
    features = response.getFeatures();
    Assert.assertNotNull(features);
    Assert.assertEquals(1, features.length);
    Assert.assertEquals("Country 3", features[0].getLabel());
    geometry = features[0].getGeometry();
    Assert.assertNotNull(geometry);
    coor = geometry.getGeometries()[0].getCoordinates()[0];
    // remark, this value is obtained using a test run, not externally verified
    Assert.assertEquals(-111319.49079327357, coor.getX(), DOUBLE_TOLERANCE);
    Assert.assertEquals(0, coor.getY(), DOUBLE_TOLERANCE);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

  // -------------------------------------------------------------------------

  public PointDrawController(MapWidget mapWidget, AbstractFreeDrawingController parent) {
    super(mapWidget, parent);
    factory = new GeometryFactory(mapWidget.getMapModel().getSrid(), mapWidget.getMapModel().getPrecision());
    geometry = factory.createPoint(new Coordinate());
    drawStyle = new ShapeStyle("#FF7F00", 0.3f, "#FF7F00", 1, 2);
    symbolStyle = new SymbolInfo();
    CircleInfo c = new CircleInfo();
    symbolStyle.setCircle(c);
    c.setR(8);
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

  // -------------------------------------------------------------------------
  // MapController implementation:
  // -------------------------------------------------------------------------

  public void onMouseDown(MouseDownEvent event) {
    Coordinate newCoords = getWorldPosition(event);
    geometry = factory.createPoint(newCoords);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

  private void createTempPoint() {
    tempPoint = new GfxGeometry("PointDrawController.updatePoint");
    tempPoint.setStyle(drawStyle);
    tempPoint.setSymbolInfo(symbolStyle);

    Coordinate coords = getTransformer().worldToPan(geometry.getCoordinate());
    Point point = (Point) geometry.getGeometryFactory().createPoint(coords);
    tempPoint.setGeometry(point);
    mapWidget.render(tempPoint, RenderGroup.VECTOR, RenderStatus.ALL);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

      LinearRing ring = geometry.getGeometryFactory().createLinearRing(polygon.getCoordinates());
      if (ring != null && geometry.getCoordinates().length > 0) {

        Coordinate[] coordinates = ring.getCoordinates();
        Coordinate firstCoordinate = coordinates[0];
        Coordinate lastCoordinate = coordinates[coordinates.length - 2];

        LineString lineString1 = geometry.getGeometryFactory().createLineString(
            new Coordinate[] { getTransformer().worldToPan(lastCoordinate), getPanPosition(event) });
        tempLine1.setGeometry(lineString1);
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

    public void onMouseUp(ListenerEvent event) {
    }

    public void onMouseMove(ListenerEvent event) {
      Coordinate worldPosition = event.getWorldPosition();
      double x = ((double) Math.round(worldPosition.getX() * 1000)) / 1000;
      double y = ((double) Math.round(worldPosition.getY() * 1000)) / 1000;
      xLabel.setContents(xText + ": " + x);
      yLabel.setContents(yText + ": " + y);
    }
View Full Code Here

Examples of org.geotools.geometry.iso.topograph2D.Coordinate

  public Node(Envelope env, int level) {
    // this.parent = parent;
    this.env = env;
    this.level = level;
    centre = new Coordinate();
    centre.x = (env.getMinX() + env.getMaxX()) / 2;
    centre.y = (env.getMinY() + env.getMaxY()) / 2;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.