本文整理汇总了Java中org.gwtopenmaps.openlayers.client.Bounds类的典型用法代码示例。如果您正苦于以下问题:Java Bounds类的具体用法?Java Bounds怎么用?Java Bounds使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bounds类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了Bounds类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@PostConstruct
private void initialize() {
customExtentDialog.getAddToMapButton().addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
if (!isBBoxEmpty() && has4Coordinates()) {
Bounds bounds = getBounds();
Geometry geom = bounds.toGeometry();
geom.transform(new Projection("EPSG:4326"),
new Projection(geoMap.getMap()
.getProjection()));
VectorFeature vf = new VectorFeature(geom);
VectorLayer bboxLayer = VectorLayerFactory
.createEmptyVectorLayer(createBBoxLayerConfig());
bboxLayer.addFeature(vf);
layerManager.addVector(bboxLayer);
}
}
});
}
示例2: onRelease
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@Override
protected void onRelease() {
Bounds bounds = geoMap.getMap().getExtent();
LonLat center = bounds.getCenterLonLat();
LonLat lower = new LonLat(bounds.getLowerLeftX(), bounds.getLowerLeftY());
LonLat upper = new LonLat(bounds.getUpperRightX(), bounds.getUpperRightY());
lower = transformToWGS84(lower);
upper = transformToWGS84(upper);
CurrentExtentInfo model = new CurrentExtentInfo();
model.setCenter(center.lat() + ", " + center.lon());
model.setLowerLeftX(lower.lon());
model.setLowerLeftY(lower.lat());
model.setUpperRightX(upper.lon());
model.setUpperRightY(upper.lat());
model.setBounds(bounds);
model.setWkt(getWKT(bounds));
model.setWktWGS84(getWKTToWGS84(bounds));
currentExtentDialog.setModel(model);
currentExtentDialog.setModal(true);
currentExtentDialog.show();
}
示例3: setDataExtent
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public void setDataExtent(double slat, double nlat, double wlon,
double elon, double delta) {
this.delta = delta;
dataBounds = new Bounds(wlon, slat, elon, nlat);
double w = dataBounds.getWidth();
double dt = Math.abs(360. - w);
if (dt <= 2. * delta) {
modulo = true;
selectionMade = false;
} else {
modulo = false;
}
zoomMap();
currentSelection = dataBounds;
lastRectangle = dataBounds;
boxLayer.destroyFeatures();
lineLayer.destroyFeatures();
editing = false;
setSelection(currentSelection);
// Add the geometry back on to the map if the tools is not a rectangle.
if (!tool.contains("xy")) {
trimSelection(currentSelection);
}
}
示例4: setBounds
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@Override
public void setBounds(Wgs84BoundsBean aBounds) {
bounds = aBounds;
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
map.updateSize();
Bounds extent = convertBounds(bounds);
map.setMaxExtent(extent);
map.setRestrictedExtent(extent);
map.zoomToExtent(extent);
// Zoom a bit inside as fitting bounds will be too large
map.setCenter(map.getCenter(), map.getZoom() + 1);
}
});
}
示例5: createMapOption
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
/**
* Creates the map option.
*
* @param isGoogle
* the is google
*/
private void createMapOption(boolean isGoogle)
{
// TODO Auto-generated method stub
OpenLayers.setProxyHost("gwtOpenLayersProxy?targetURL=");
this.defaultMapOptions = new MapOptions();
this.defaultMapOptions.setNumZoomLevels(18);
if (isGoogle)
{
this.defaultMapOptions.setProjection("EPSG:900913");
this.defaultMapOptions.setDisplayProjection(new Projection("EPSG:4326"));
this.defaultMapOptions.setUnits(MapUnits.METERS);
this.defaultMapOptions.setMaxExtent(new Bounds(-20037508, -20037508, 20037508,
20037508.34));
this.defaultMapOptions.setMaxResolution(new Double(156543.0339).floatValue());
}
else
{
this.defaultMapOptions.setProjection("EPSG:4326");
}
initMapWidget(this.defaultMapOptions, isGoogle);
}
示例6: StationSelectorMap
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public StationSelectorMap(MapController controller) {
super("523px"); // XXX map needs explicit height in px
getMapWidget().setStylePrimaryName("n52-sensorwebclient-stationselector-map");
this.controller = controller;
map.addLayer(markerLayer);
try {
if (isDefinedGlobalExtent()) {
PropertiesManager propertiesMgr = getPropertiesManager();
double lleftX = new Double(propertiesMgr.getParameterAsString("lleftX"));
double lleftY = new Double(propertiesMgr.getParameterAsString("lleftY"));
double urightX = new Double(propertiesMgr.getParameterAsString("urightX"));
double urightY = new Double(propertiesMgr.getParameterAsString("urightY"));
defaultExtent = new Bounds(lleftX, lleftY, urightX, urightY);
}
else {
GWT.log("No global extent configured. Zooming to: " + FALLBACK_EXTENT);
defaultExtent = FALLBACK_EXTENT;
}
}
catch (NumberFormatException e) {
GWT.log("Error while parsing configured bounding box. Zooming to: " + FALLBACK_EXTENT);
defaultExtent = FALLBACK_EXTENT;
}
zoomToExtent(defaultExtent);
}
示例7: zoomToMarkers
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public void zoomToMarkers() {
try {
if (markerLayer != null) {
Bounds bbox = markerLayer.getDataExtent();
if (bbox != null) {
int z = map.getZoomForExtent(bbox, false);
map.zoomToExtent(bbox);
map.zoomTo(z);
}
}
}
catch (Exception e) {
if ( !GWT.isProdMode()) {
GWT.log("", e);
}
}
}
示例8: getDefaultMapBound
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public Bounds getDefaultMapBound() {
final double lowerLeftX = appClientProperties.getFloatValue("lowerLeftX");
final double lowerLeftY = appClientProperties.getFloatValue("lowerLeftY");
final double upperRightX = appClientProperties.getFloatValue("upperRightX");
final double upperRightY = appClientProperties.getFloatValue("upperRightY");
return new Bounds(lowerLeftX,lowerLeftY,upperRightX,upperRightY);
}
示例9: createVectorLayer
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
private void createVectorLayer(Bounds bounds) {
if (layer == null) {
layer = new VectorLayer("LockedBBox");
layer.setStyleMap(new StyleMap(createStyle()));
}
layer.removeAllFeatures();
Geometry geom = bounds.toGeometry();
VectorFeature vf = new VectorFeature(geom);
layer.addFeature(vf);
getGeoMap().getMap().addLayer(layer);
}
示例10: confirmClearMaxExtent
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
private void confirmClearMaxExtent(final boolean value) {
ConfirmMessageBox messageBox = messageDialogBuilder.createConfirm(
UIMessages.INSTANCE.edtAlertDialogTitle(),
UIMessages.INSTANCE.confirmClearMaxExtent(),
ImageProvider.INSTANCE.currentExtent24());
messageBox.getButton(PredefinedButton.YES).addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
Bounds defaultBounds = getGeoMap().getDefaultMapBound();
getGeoMap().getMap().setRestrictedExtent(defaultBounds);
getGeoMap().getMap().setMaxExtent(defaultBounds);
setText(UIMessages.INSTANCE.nameLockCurrentExtentTool());
setIcon(ImageProvider.INSTANCE.unlockedExtension24());
getGeoMap().getMap().zoomToExtent(
layer.getDataExtent(), true);
getGeoMap().getMap().removeLayer(layer);
}
});
messageBox.getButton(PredefinedButton.NO).addSelectHandler(
getNoSelectHandler(value));
messageBox.show();
}
示例11: getBounds
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
private Bounds getBounds() {
String[] coordinates = customExtentDialog.getBbox().split("\\,");
double lowerLeftX = Double.parseDouble(coordinates[0]);
double lowerLeftY = Double.parseDouble(coordinates[1]);
double upperRightX = Double.parseDouble(coordinates[2]);
double upperRightY = Double.parseDouble(coordinates[3]);
return new Bounds(lowerLeftX, lowerLeftY, upperRightX, upperRightY);
}
示例12: getWKTToWGS84
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
private String getWKTToWGS84(Bounds bounds) {
Geometry geom = bounds.toGeometry().clone();
geom.transform(new Projection(geoMap.getMap().getProjection()), new Projection("EPSG:4326"));
VectorFeature extentFeature = new VectorFeature(geom);
WKT wktFormat = new WKT();
return wktFormat.write(extentFeature);
}
示例13: onClick
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@Override
public void onClick() {
Vector layer = (Vector) getSelectedLayer();
Bounds layerExtent = layer.getDataExtent();
if (layerExtent == null) {
Info.display(UIMessages.INSTANCE.zoomToVectorLayerToolText(),
UIMessages.INSTANCE.emptyVectorLayer());
}
geoMap.getMap().zoomToExtent(layerExtent);
}
示例14: setDataExtentOnly
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public void setDataExtentOnly(double slat, double nlat, double wlon,
double elon, double delta) {
this.delta = delta;
dataBounds = new Bounds(wlon, slat, elon, nlat);
double w = dataBounds.getWidth();
double dt = Math.abs(360. - w);
if (dt <= 2. * delta) {
modulo = true;
selectionMade = false;
} else {
modulo = false;
}
}
示例15: onMapMove
import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@Override
public void onMapMove(MapMoveEvent eventObject) {
LonLat center = map.getCenter();
if (modulo && !selectionMade) {
setSelection(new Bounds(center.lon() - 180.0,
center.lat() - 90., center.lon() + 180.0,
center.lat() + 90.));
}
}