Package org.geomajas.geometry

Examples of org.geomajas.geometry.Coordinate


    final GfxGeometry worldGeometry2 = new GfxGeometry("MultiPointInWorldSpace");
    SymbolInfo si = new SymbolInfo();
    CircleInfo ci = new CircleInfo();
    ci.setR(8.0f);
    si.setCircle(ci);
    Point pt1 = gf.createPoint(new Coordinate(6000000, -5000000));
    Point pt2 = gf.createPoint(new Coordinate(8000000, -5000000));
    Point pt3 = gf.createPoint(new Coordinate(7000000, -7000000));
    worldGeometry2.setStyle(new ShapeStyle("#0000FF", 0.3f, "#0000FF", 1.0f, 2));
    worldGeometry2.setGeometry(gf.createMultiPoint(new Point[] {pt1, pt2, pt3}));
    worldGeometry2.setSymbolInfo(si);

    button2.addClickHandler(new ClickHandler() {
View Full Code Here


    button1.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        ShapeStyle style = new ShapeStyle("#66CC22", 0.5f, "#66AA22", 1, 2);
        map.getVectorContext().drawCircle(group1, "circle", new Coordinate(200, 100), 30, style);
      }
    });
    button1.setWidth100();
    column1.addMember(button1);

    // Button2: Draw LineString
    IButton button2 = new IButton(I18nProvider.getSampleMessages().renderingDrawLineString());
    button2.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        LineString geometry = map.getMapModel().getGeometryFactory().createLineString(
            new Coordinate[] { new Coordinate(60, 20), new Coordinate(120, 80), new Coordinate(80, 100) });
        ShapeStyle style = new ShapeStyle("#994488", 0.0f, "#993388", 1, 2);
        map.getVectorContext().drawLine(group2, "LineString", geometry, style);
      }
    });
    button2.setWidth100();
    column1.addMember(button2);

    // Button3: Draw Polygon
    IButton button3 = new IButton(I18nProvider.getSampleMessages().renderingDrawPolygon());
    button3.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        GeometryFactory factory = map.getMapModel().getGeometryFactory();
        LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(110, 10),
            new Coordinate(210, 10), new Coordinate(210, 110), new Coordinate(110, 110),
            new Coordinate(110, 10) });
        LinearRing hole = factory.createLinearRing(new Coordinate[] { new Coordinate(140, 40),
            new Coordinate(170, 40), new Coordinate(170, 70), new Coordinate(140, 70),
            new Coordinate(140, 40) });
        Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });
        ShapeStyle style = new ShapeStyle("#9933EE", 0.5f, "#9900FF", 1, 2);
        map.getVectorContext().drawPolygon(group2, "Polygon", polygon, style);
      }
    });
    button3.setWidth100();
    column1.addMember(button3);

    // Button4: Draw Text
    IButton button4 = new IButton(I18nProvider.getSampleMessages().renderingDrawText());
    button4.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        FontStyle style = new FontStyle("#FF0000", 12, "Verdana", "normal", "normal");
        map.getVectorContext()
            .drawText(group1, "text", "This is some text...", new Coordinate(100, 120), style);
      }
    });
    button4.setWidth100();
    column2.addMember(button4);
View Full Code Here

    map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
  }-*/;

  private Bbox convertToLatLon(Bbox bounds) {
    // convert corners
    Coordinate orig = convertToLatLon(bounds.getOrigin());
    Coordinate end = convertToLatLon(bounds.getEndPoint());
    return new Bbox(orig.getX(), orig.getY(), end.getX() - orig.getX(), end.getY() - orig.getY());
  }
View Full Code Here

  private Coordinate convertToLatLon(Coordinate coordinate) {
    double lat = (coordinate.getY() / MERCATOR_WIDTH) * HALF_CIRCLE;
    double lon = (coordinate.getX() / MERCATOR_WIDTH) * HALF_CIRCLE;
    lat = HALF_CIRCLE / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / HALF_CIRCLE)) - Math.PI / 2.0);
    return new Coordinate(lat, lon);
  }
View Full Code Here

    map.getLayoutConstraint().setMarginX(marginX);
    map.getLayoutConstraint().setMarginY(marginY);
    MapView view = mapModel.getMapView();
    double mapWidth = getPageWidth() - 2 * marginX;
    double mapHeight = getPageHeight() - 2 * marginY;
    Coordinate origin = view.getBounds().createFittingBox(mapWidth, mapHeight).getOrigin();
    map.setLocation(new org.geomajas.geometry.Coordinate(origin.getX(), origin.getY()));
    map.setPpUnit((float) (mapWidth / view.getBounds().createFittingBox(mapWidth, mapHeight).getWidth()));
    map.setTag("map");
    map.setMapId(mapModel.getMapInfo().getId());
    map.setApplicationId(applicationId);
    map.setRasterResolution(rasterDpi);
View Full Code Here

    mapRasterizingInfo.setTransparent(true);
    mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);

    ClientGeometryLayerInfo geo = new ClientGeometryLayerInfo();
    Geometry point = new Geometry(Geometry.POINT, 4326, 5);
    point.setCoordinates(new Coordinate[] { new Coordinate(20, 50) });
    geo.getGeometries().add(point);
    geo.setStyle(layerBeansPointStyleInfo.getFeatureStyles().get(0));
    geo.setLayerType(LayerType.POINT);
    mapInfo.getLayers().add(geo);
    new MapAssert(mapInfo).assertEqualImage("geometry.png", writeImages, DELTA);
View Full Code Here

  public void execute(PipelineContext context, GetTileContainer response) throws GeomajasException {
    TileMetadata tileMetadata = context.getOptional(PipelineCode.TILE_METADATA_KEY, TileMetadata.class);
    if (tileMetadata != null) {
      // set to origin
      tileMetadata.setPanOrigin(new Coordinate());
    }
  }   
View Full Code Here

    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeans.getId());
    metadata.setPanOrigin(new Coordinate(0, 0));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
View Full Code Here

    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeansPoint.getId());
    metadata.setPanOrigin(new Coordinate(1, 1));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansPointStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
View Full Code Here

  private GetVectorTileRequest createRequest() {
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeansMultiLine.getId());
    metadata.setPanOrigin(new Coordinate(12, 10));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansMultiLineStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
View Full Code Here

TOP

Related Classes of org.geomajas.geometry.Coordinate

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.