• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Bounds类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gwtopenmaps.openlayers.client.Bounds的典型用法代码示例。如果您正苦于以下问题:Java Bounds类的具体用法?Java Bounds怎么用?Java Bounds使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Bounds类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了Bounds类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
					}
				}
			});
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:27,代码来源:CustomExtentTool.java


示例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();		
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:27,代码来源:CurrentExtentTool.java


示例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);
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:25,代码来源:OLMapWidget.java


示例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);
		}
	});
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:17,代码来源:OpenLayersPlannerMapWidget.java


示例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);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:31,代码来源:MapPreviewWidget.java


示例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);
}
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:26,代码来源:StationSelectorMap.java


示例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);
        }
    }
}
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:18,代码来源:StationSelectorMap.java


示例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);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:9,代码来源:GeoMap.java


示例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);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:LockCurrentExtentTool.java


示例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();
	}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:29,代码来源:LockCurrentExtentTool.java


示例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);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:CustomExtentTool.java


示例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);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:8,代码来源:CurrentExtentTool.java


示例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);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:11,代码来源:ZoomToVectorLayerTool.java


示例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;
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:14,代码来源:OLMapWidget.java


示例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.));
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:OLMapWidget.java


示例16: isContainedBy

import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
public boolean isContainedBy(String xlo, String xhi, String ylo, String yhi) {
	double dxl = Double.valueOf(xlo);
	double dxh = Double.valueOf(xhi);
	double dyl = Double.valueOf(ylo);
	double dyh = Double.valueOf(yhi);
	Bounds originalBounds = new Bounds(dxl, dyl, dxh, dyh);
	return originalBounds.containsBounds(currentSelection, false, true);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:OLMapWidget.java


示例17: zoomToBounds

import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
/** Zooms to a specified bounding box.
 * 
 * @param bounds
 */
public void zoomToBounds(Bounds bounds) {	
	if(bounds == null){
		return;
	}
	bounds = bounds.transform( new Projection("EPSG: 900913"), new Projection("EPSG: 4326"));
	this.map.zoomToExtent(bounds);
}
 
开发者ID:selu285-2015,项目名称:285_02_FA15G4,代码行数:12,代码来源:PlaceMapWidget.java


示例18: printContacts

import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
/**
 * Prints the given {@link ReducedContact}s on this MapWidget.
 * 
 * @param contacts
 *            - a list of {@link ReducedContact} objects resulting from search
 */		
public void printContacts(List<? extends ReducedContact> contacts) {
	getVectorLayer().destroyFeatures();
	Style pointStyle = new Style();		
	for (ReducedContact c : contacts) {

		Point point = new Point(c.getLongitude(), c.getLatitude());
		point.transform(proj, new Projection(map.getProjection()));
			
		pointStyle.setExternalGraphic("img/map_marker_red.png");
		pointStyle.setGraphicSize(10, 17);
		pointStyle.setFillOpacity(1.0);

		VectorFeature pointFeature = new VectorFeature(point, pointStyle);
		pointFeature.getAttributes().setAttribute(Const.FEATURE_ATTRIBUTE_CONTACT_ID, c.getId());
		pointFeature.setFeatureId(c.getId());
		getVectorLayer().addFeature(pointFeature);			
	}

	Bounds dataExtent = getVectorLayer().getDataExtent();
	boolean outOfBounds = !maxVisibleExtent.containsBounds(dataExtent, false, true);
	if(!outOfBounds){		
		zoomToBounds(getVectorLayer().getDataExtent());			
	}else{
		this.setCenter(new LonLat(8, 48), 5);
	}
}
 
开发者ID:selu285-2015,项目名称:285_02_FA15G4,代码行数:33,代码来源:PlaceMapWidget.java


示例19: displayBounds

import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
@Override
protected void displayBounds(BoundingBoxDTO bounds) {
	final LonLat lower = new LonLat(bounds.getX1(), bounds.getY1());
   	lower.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
	
   	final LonLat upper = new LonLat(bounds.getX2(), bounds.getY2());
   	upper.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
   	
       final Bounds b = new Bounds(lower.lon(), lower.lat(), upper.lon(), upper.lat());
       mapWidget.getMap().setCenter(b.getCenterLonLat(), 
       		mapWidget.getMap().getZoomForExtent(b, false));
       
       mapWidget.getMap().updateSize();
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:15,代码来源:OpenStreetMapWorldMap.java


示例20: toGWTBounds

import org.gwtopenmaps.openlayers.client.Bounds; //导入依赖的package包/类
private static GWTBounds toGWTBounds(final Bounds fromBounds) {
    if (fromBounds == null) {
        return new GWTBounds(-180, -90, 180, 90);
    }
    final Bounds bounds = fromBounds.transform(PROJECTION_SPHERICAL_MERCATOR, PROJECTION_LAT_LON);
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(Math.max(-90, bounds.getLowerLeftY()), Math.max(-180, bounds.getLowerLeftX()));
    bldr.extend(Math.min(90, bounds.getUpperRightY()), Math.min(180, bounds.getUpperRightX()));
    return bldr.getBounds();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:11,代码来源:OpenLayersMapPanel.java



注:本文中的org.gwtopenmaps.openlayers.client.Bounds类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SignatureAttribute类代码示例发布时间:2022-05-22
下一篇:
Java TransformBase64Decode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap