public static Bounds narrowToBounds(JSObject element) { return (element == null)?null:new Bounds(element); }
public LonLat getCenterLonLat() { return Bounds.narrowToBounds(FeatureImpl.getBounds(this.getJSObject())).getCenterLonLat(); }
public boolean containsBounds(Bounds bounds, boolean partial, boolean contains) { return BoundsImpl.containsBounds(getJSObject(), bounds.getJSObject(), partial, contains); }
/** * @param x * @param y * @return A new bounds whose coordinates are the same as this, but shifted * by the passed-in x and y values. */ public Bounds add(float x, float y) { return Bounds.narrowToBounds(BoundsImpl.add(this.getJSObject(), x, y)); }
Bounds b = new Bounds(new Double(llX), new Double(llY), new Double(urX), new Double(urY)); String mapProjection = OverviewMap.this.getMapProjection(); LonLat centerLonLat = b.getCenterLonLat(); if (!mapProjection.equals(Constants.DISPLAY_PROJECTION)) { centerLonLat.transform(Constants.DISPLAY_PROJECTION, mapProjection); lowerleft.transform(Constants.DISPLAY_PROJECTION, mapProjection); upperright.transform(Constants.DISPLAY_PROJECTION, mapProjection); b = new Bounds(lowerleft.lon(),lowerleft.lat(),upperright.lon(),upperright.lat());
@Deprecated public Bounds getBounds() { return Bounds.narrowToBounds(GetFeatureImpl.getBounds(getJSObject())); }
public BoundingBox getCurrentExtent() { Bounds bbox = map.getExtent(); LonLat ll = new LonLat(bbox.getLowerLeftX(), bbox.getLowerLeftY()); LonLat ur = new LonLat(bbox.getUpperRightX(), bbox.getUpperRightY()); if (!GWT.isProdMode()) { StringBuilder sb = new StringBuilder("Transforming: \n"); sb.append("ll: ").append(getAsString(ll)).append(", "); sb.append("ur: ").append(getAsString(ur)); GWT.log(sb.append("...").toString()); } ll.transform(getMapProjection(), EPSG_4326); ur.transform(getMapProjection(), EPSG_4326); if (!GWT.isProdMode()) { StringBuilder sb = new StringBuilder("... transformed to: \n"); sb.append("ll: ").append(getAsString(ll)).append(", "); sb.append("ur: ").append(getAsString(ur)); GWT.log(sb.toString()); } EastingNorthing ll2 = new EastingNorthing(ll.lon(), ll.lat(), EPSG_4326); EastingNorthing ur2 = new EastingNorthing(ur.lon(), ur.lat(), EPSG_4326); return new BoundingBox(ll2, ur2); }
public void zoomToMarkers() { Bounds bbox = markerLayer.getDataExtent(); if (bbox != null) { map.setCenter(bbox.getCenterLonLat()); if (markersOnMap.size() > 1) { map.zoomToExtent(bbox); } else { map.zoomTo(DEFAULT_ZOOM_LEVEL); } } }
/** * Scales the bounds. * * @param ratio * @return a new bounds that is scaled by ratio */ public Bounds scale(float ratio) { return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio, null)); }
/** * Calculates the max extent which includes all of the features of this * vector layer. * * @return The bounds of the max extend calculated */ public Bounds getDataExtent() { return Bounds.narrowToBounds(VectorImpl.getDataExtentImp(getJSObject())); }
/** * Determine whether the target bounds intersects this bounds. Bounds are * considered intersecting if any of their edges intersect or if one bounds * contains the other. * * @param bounds the target bounds * @return whether the passed-in bounds object intersects this bounds */ public boolean intersectsBounds(Bounds bounds) { return BoundsImpl.intersectsBounds(this.getJSObject(), bounds.getJSObject()); } }
public static Bounds narrowToBounds(JSObject element) { return (element == null) ? null : new Bounds(element); }
/** * Scales the bounds around a LonLat. * * @param ratio * @param origin default is center * @return a new bounds that is scaled by ratio from origin */ public Bounds scale(float ratio, LonLat origin) { JSObject originJsObj = (origin == null) ? null : origin.getJSObject(); return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio, originJsObj)); }
public Bounds getMaxExtent() { return Bounds.narrowToBounds(getJSObject().getProperty("maxExtent")); } }
public LonLat getCenterLonLat() { return Bounds.narrowToBounds(FeatureImpl.getBounds(this.getJSObject())).getCenterLonLat(); }
public boolean containsBounds(Bounds bounds, boolean partial, boolean contains ) { return BoundsImpl.containsBounds(getJSObject(), bounds.getJSObject(), partial, contains); } }
public Bounds getExtent(){ return new Bounds(MapImpl.getExtent(getJSObject())); }
/** * Scales the bounds around a pixel. Note that the new bounds may return * non-integer properties. * * @param ratio * @param origin default is center * @return a new bounds that is scaled by ratio from origin */ public Bounds scale(float ratio, Pixel origin) { JSObject originJsObj = (origin == null) ? null : origin.getJSObject(); return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio, originJsObj)); }
@Override public Bounds getMaxExtent() { return Bounds.narrowToBounds(getJSObject().getProperty("maxExtent")); }
/** * @param significantDigits - Number of significant digits in the bbox coordinates, * pass null to use the default of 6. * @return String - simple string representation of a Bounds object. For example: * "5,42,10,45" */ public String toBBox(Integer significantDigits){ return BoundsImpl.toBBox(getJSObject(), significantDigits); }