Examples of computeBoundingBox()


Examples of aimax.osm.data.entities.MapWay.computeBoundingBox()

    if (entity instanceof MapNode) {
      return getDistKM(lat, lon, ((MapNode) entity).getLat(),
          ((MapNode) entity).getLon());
    } else if (entity instanceof MapWay) {
      MapWay way = (MapWay) entity;
      BoundingBox bb = way.computeBoundingBox();
      float bbLat = (Math.abs(lat - bb.getLatMin()) < Math.abs(lat
          - bb.getLatMax())) ? bb.getLatMin() : bb.getLatMax();
      float bbLon = (Math.abs(lon - bb.getLonMin()) < Math.abs(lon
          - bb.getLonMax())) ? bb.getLonMin() : bb.getLonMax();
      return getDistKM(lat, lon, bbLat, bbLon);
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor.computeBoundingBox()

        protected void computeBboxAndCenterScale(Bounds bounds) {
            BoundingXYVisitor v = new BoundingXYVisitor();
            if (bounds != null) {
                v.visit(bounds);
            } else {
                v.computeBoundingBox(dataSet.getNodes());
            }
            // Main.map.mapView.recalculateCenterScale(v);
        }
    }
}
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor.computeBoundingBox()

        zoomTo(sel);
    }

    public static void zoomTo(Collection<OsmPrimitive> sel) {
        BoundingXYVisitor bboxCalculator = new BoundingXYVisitor();
        bboxCalculator.computeBoundingBox(sel);
        // increase bbox by 0.001 degrees on each side. this is required
        // especially if the bbox contains one single node, but helpful
        // in most other cases as well.
        bboxCalculator.enlargeBoundingBox();
        if (bboxCalculator.getBounds() != null) {
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor.computeBoundingBox()

        @Override
        public void actionPerformed(ActionEvent e) {
            BoundingXYVisitor box = new BoundingXYVisitor();
            Collection<OsmPrimitive> sel = model.getSelected();
            if (sel.isEmpty()) return;
            box.computeBoundingBox(sel);
            if (box.getBounds() == null)
                return;
            box.enlargeBoundingBox();
            Main.map.mapView.recalculateCenterScale(box);
        }
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor.computeBoundingBox()

        protected void computeBboxAndCenterScale() {
            BoundingXYVisitor v = new BoundingXYVisitor();
            if (currentBounds != null) {
                v.visit(currentBounds);
            } else {
                v.computeBoundingBox(dataSet.getNodes());
            }
            Main.map.mapView.recalculateCenterScale(v);
        }

        @Override protected void cancel() {
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.