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

Java Projection类代码示例

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

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



Projection类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了Projection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTransformedFeatures

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private VectorFeature[] getTransformedFeatures(Vector vectorLayer, String epsg) {
		List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
		if (vectorLayer.getFeatures() != null) {
//			logger.info("N. features de la Capa: " + layer.getFeatures().length);
			for (VectorFeature feature : vectorLayer.getFeatures()) {
				VectorFeature featureToExport = feature.clone();
				featureToExport.getGeometry().transform(
						new Projection(GeoMap.INTERNAL_EPSG),
						new Projection(epsg));
				transformedFeatures.add(featureToExport);
			}
		}
		VectorFeature[] transArray = new VectorFeature[transformedFeatures
				.size()];
		return transformedFeatures.toArray(transArray);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:SaveProjectTool.java


示例2: initialize

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的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


示例3: getTransformedFeatures

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private VectorFeature[] getTransformedFeatures() {
	List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
	if (layer.getFeatures() != null) {
		logger.info("N. features de la Capa: " + layer.getFeatures().length);
		for (VectorFeature feature : layer.getFeatures()) {
			VectorFeature featureToExport = feature.clone();
			featureToExport.getGeometry().transform(
					new Projection(GeoMap.INTERNAL_EPSG),
					new Projection("WGS84"));
			transformedFeatures.add(featureToExport);
		}
	}
	VectorFeature[] transArray = new VectorFeature[transformedFeatures
			.size()];
	return transformedFeatures.toArray(transArray);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:SaveLayerTool.java


示例4: createMapOption

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的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


示例5: configure

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void configure(final Projection displayProjection, final Integer numZoomLevels, final String units) {
	this.displayProjection = displayProjection; 		

	mapOptions = new MapOptions();
mapOptions.setDisplayProjection(this.displayProjection);
mapOptions.setNumZoomLevels(numZoomLevels);
mapOptions.setUnits(units);
mapOptions.setMaxExtent(getDefaultMapBound());
mapOptions.setMaxResolution(appClientProperties.getFloatValue("maxResolution"));
getMap().setOptions(mapOptions);
getMap().setMinMaxZoomLevel(0, 20);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:13,代码来源:GeoMap.java


示例6: generateBbox

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void generateBbox() {
	queryBbox = true;
	GeoMap geoMap = IOC.getBeanManager().lookupBean(GeoMap.class)
			.getInstance();
	if (GeoMap.INTERNAL_EPSG.equals(getEpsg())) {
		this.bbox = geoMap.getMap().getExtent();
	} else {
		this.bbox = geoMap.getMap().getExtent()
				.transform(new Projection(GeoMap.INTERNAL_EPSG),
						new Projection(getEpsg()));
	}
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:13,代码来源:WfsVectorLayerDef.java


示例7: calculatePolygonLenght

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private double calculatePolygonLenght(Polygon polygon) {
	double lenght = 0;
	for (LinearRing ring : polygon.getComponents()) {
		lenght = lenght
				+ ring.getGeodesicLength(new Projection(
						GeoMap.INTERNAL_EPSG));
	}
	return lenght;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:MeasureElementTool.java


示例8: getWKTToWGS84

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的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


示例9: getTransformedFeatures

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public VectorFeature[] getTransformedFeatures(Vector layer, String epsg) {
	List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
	if (layer.getFeatures() != null) {
		for (VectorFeature feature : layer.getFeatures()) {
			VectorFeature featureToExport = feature.clone();
			featureToExport.getGeometry().transform(
					new Projection(geoMap.getMap().getProjection()),
					new Projection(epsg));
			transformedFeatures.add(featureToExport);
		}
	}
	VectorFeature[] transArray = new VectorFeature[transformedFeatures
			.size()];
	return transformedFeatures.toArray(transArray);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:16,代码来源:ExportDataTool.java


示例10: configure

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void configure(final Projection displayProjection, final Integer numZoomLevels, final String units) {
	this.displayProjection = displayProjection; 		

	mapOptions = new MapOptions();
mapOptions.setDisplayProjection(this.displayProjection);
mapOptions.setNumZoomLevels(numZoomLevels);
mapOptions.setUnits(units);
mapOptions.setMaxExtent(getDefaultMapBound());
mapOptions.setMaxResolution(appClientProperties.getFloatValue("maxResolution"));
getMap().setOptions(mapOptions);
getMap().setMinMaxZoomLevel(0, 50);
}
 
开发者ID:geowe,项目名称:geowe-core,代码行数:13,代码来源:GeoMap.java


示例11: zoomToBounds

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的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


示例12: printContacts

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的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


示例13: PlotPointDiary

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void PlotPointDiary(Boolean plot) {
	map.addLayer(diaryVectorLayer);
	Style pointStyle = new Style();	
	
	if (plot == true) {
		System.out.println(MaryList.getSize());
		for (int i=0; i<MaryList.getSize(); i++) {
			ReducedContact c = MaryList.getReducedContact(i);
		
			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());
			diaryVectorLayer.addFeature(pointFeature);
		}
		ruskinControl.deactivate();
		allControl.deactivate();
		diaryControl.activate();
	}
	else {
		eraseDiaryContacts();
		diaryControl.deactivate();
		map.removeLayer(diaryVectorLayer);
	}
}
 
开发者ID:selu285-2015,项目名称:285_02_FA15G4,代码行数:32,代码来源:PlaceMapWidget.java


示例14: PlotPointsRuskin

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void PlotPointsRuskin (Boolean plot) {
	Style pointStyle = new Style();	
	map.addLayer(ruskinVectorLayer);
	if (plot == true) {
		ReducedContact c = new ReducedContact("John Was Here", 60, 40);
		
		LonLat ll = c.getCoordinate();
		Point point = new Point(ll.lon(), ll.lat());
		point.transform(proj, new Projection(map.getProjection()));	
		pointStyle.setExternalGraphic("img/map_marker_blue.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());
		ruskinVectorLayer.addFeature(pointFeature);
		
		allControl.deactivate();
		diaryControl.deactivate();
		ruskinControl.activate();
	}
	else {
		eraseRuskinContacts();	
		ruskinControl.deactivate();
		map.removeLayer(ruskinVectorLayer);
	}
}
 
开发者ID:selu285-2015,项目名称:285_02_FA15G4,代码行数:29,代码来源:PlaceMapWidget.java


示例15: drawAoiOnMap

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
/**
 * Draw aoi on map.
 *
 * @param wkt
 *            the wkt
 */
public void drawAoiOnMap(String wkt)
{
    this.eraseFeatures();

    MultiPolygon geom = MultiPolygon.narrowToMultiPolygon(Geometry.fromWKT(wkt).getJSObject());
    geom.transform(new Projection("EPSG:4326"), new Projection("EPSG:900913"));

    VectorFeature vectorFeature = new VectorFeature(geom);
    this.vector.addFeature(vectorFeature);
    this.map.zoomToExtent(geom.getBounds());
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:18,代码来源:MapPreviewWidget.java


示例16: getDisplayProjection

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public Projection getDisplayProjection() {
	return displayProjection;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:4,代码来源:GeoMap.java


示例17: getProjection

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public Projection getProjection() {		
	return new Projection(getEpsg());
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:4,代码来源:VectorLayerConfig.java


示例18: getDefaultProjection

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public Projection getDefaultProjection() {
	return DEFAUL_PROJECTION;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:4,代码来源:VectorLayerConfig.java


示例19: getTransformedFeatures

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private VectorFeature getTransformedFeatures(VectorFeature vectorFeature) {
	VectorFeature featureToExport = vectorFeature.clone();
	featureToExport.getGeometry().transform(new Projection(GeoMap.INTERNAL_EPSG), new Projection(this.projection));

	return featureToExport;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:7,代码来源:CSV.java


示例20: PlotPointAll

import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void PlotPointAll(Boolean plot) {
		map.addLayer(allVectorLayer);
		Style pointStyle = new Style();		
		Style pointStyle2 = new Style();		
		
		if (plot == true) {
			for (int i=0; i<MaryList.getSize(); i++) {
				ReducedContact c = MaryList.getReducedContact(i);
			
				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());
				allVectorLayer.addFeature(pointFeature);
			}
			
//			ReducedContact c2 = new ReducedContact("John Was Here", 60, 40);
//			
//			LonLat ll2 = c2.getCoordinate();
//			Point point2 = new Point(ll2.lon(), ll2.lat());
//			point2.transform(proj, new Projection(map.getProjection()));	
//			pointStyle2.setExternalGraphic("img/map_marker_blue.png");
//			pointStyle2.setGraphicSize(10, 17);
//			pointStyle2.setFillOpacity(1.0);
//
//			VectorFeature pointFeature2 = new VectorFeature(point2, pointStyle2);
//			pointFeature2.getAttributes().setAttribute(Const.FEATURE_ATTRIBUTE_CONTACT_ID, c2.getId());
//			pointFeature2.setFeatureId(c2.getId());
//			allVectorLayer.addFeature(pointFeature2);
//			
			ruskinControl.deactivate();
			diaryControl.deactivate();
			allControl.activate();
		}
		else {
			eraseAllContacts();
			allControl.deactivate();
			map.removeLayer(allVectorLayer);
		}
	}
 
开发者ID:selu285-2015,项目名称:285_02_FA15G4,代码行数:47,代码来源:PlaceMapWidget.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java AuthenticationHandler类代码示例发布时间:2022-05-22
下一篇:
Java RowCacheKey类代码示例发布时间: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