当前位置: 首页>>代码示例>>Java>>正文


Java LonLat.transform方法代码示例

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


在下文中一共展示了LonLat.transform方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMouseMoverEventHandler

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private EventHandler getMouseMoverEventHandler() {
	return new EventHandler() {
		@Override
		public void onHandle(final EventObject eventObject) {
			final LonLat lonlat = getLonLat(eventObject);
			if (!GeoMap.INTERNAL_EPSG.equals(geoMap.getDisplayProjection()
					.getProjectionCode())) {
				lonlat.transform(GeoMap.INTERNAL_EPSG, geoMap
						.getDisplayProjection().getProjectionCode());
			}
			final Double scale = Double.valueOf((geoMap.getMap().getScale()));
			statusPanelWidget.setScale("1:" + scale.intValue());
			statusPanelWidget.setCurrentCoordinate(lonlat);
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:GeoMapInitializer.java

示例2: getMouseClickEventHandler

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private EventHandler getMouseClickEventHandler() {
	return new EventHandler() {
		@Override
		public void onHandle(final EventObject eventObject) {
			final LonLat lonlat = getLonLat(eventObject);

			if (!GeoMap.INTERNAL_EPSG.equals(geoMap.getDisplayProjection()
					.getProjectionCode())) {
				lonlat.transform(GeoMap.INTERNAL_EPSG, geoMap
						.getDisplayProjection().getProjectionCode());
			}

			statusPanelWidget.setClickedCoordinates(lonlat.lon(),
					lonlat.lat());
			if (w3wTool.isActive()) {
				showW3WPosition(eventObject);
			}
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:21,代码来源:GeoMapInitializer.java

示例3: init

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void init() {
	mapWidget = new MapWidget("100%", "100%", new MapOptions());
	
	// Humanitarian layer
	final OSMOptions hotOption = new OSMOptions();
	hotOption.setIsBaseLayer(true);
	hotOption.crossOriginFix();
	hotOption.setSphericalMercator(true);

	XYZ HOTLayer = new XYZ(I18N.CONSTANTS.humanitarianOSMLayer(), "http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png", hotOption);
			
	// Basic layer
	OSM osmMapnik = new OSM();
	osmMapnik.setName(I18N.CONSTANTS.basicOSMLayer());
	osmMapnik.setIsBaseLayer(true);
	
	// Pin layer
	vectorLayer = new Vector(I18N.CONSTANTS.projectSitesLayer());
	
	// Drag & drop listeners
	dragFeature = createDraggableFeature(vectorLayer);
	
	// Center & zoom
	LonLat lonLat = new LonLat(0, 0);
	lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
	
	mapWidget.getMap().addLayer(HOTLayer);
	mapWidget.getMap().addLayer(osmMapnik);
	mapWidget.getMap().addLayer(vectorLayer);
	mapWidget.getMap().addControl(new LayerSwitcher());
	mapWidget.getMap().setCenter(lonLat, 1);
	mapWidget.getMap().updateSize();
	
	getRoot().add(mapWidget);
	setInitialized(true);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:38,代码来源:OpenStreetMapWorldMap.java

示例4: displayBounds

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

示例5: displayCenterAndZoom

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void displayCenterAndZoom(double latitude, double longitude, int zoom) {
	final LonLat lonLat = new LonLat(longitude, latitude);
   	lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
	
	mapWidget.getMap().setCenter(lonLat, zoom);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:OpenStreetMapWorldMap.java

示例6: createNativePin

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected VectorFeature createNativePin(Pin pin) {
	final Style style = new Style();
	
	if(pin.getTitle() != null) {
		style.setLabel(pin.getTitle());
	}
	
	if(pin.getImageURL() != null) {
		style.setExternalGraphic(pin.getImageURL());
		style.setGraphicSize(pin.getImageWidth(), pin.getImageHeight());
		style.setGraphicOffset(
			// Horizontal center
			-pin.getImageWidth() / 2, 
			// Bottom
			-pin.getImageHeight());
	} else {
		style.setExternalGraphic("http://www.google.com/mapfiles/marker.png");
		style.setGraphicSize(20, 34);
		style.setGraphicOffset(-10, -34);
	}
	style.setFillOpacity(1.0);
	
	if(pin.isDraggable() && !draggable) {
		draggable = true;
		mapWidget.getMap().addControl(dragFeature);
		dragFeature.activate();
	}

	final LonLat lonLat = new LonLat(pin.getLongitude(), pin.getLatitude());
	lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());

	final Point point = new Point(lonLat.lon(), lonLat.lat());
	
	final VectorFeature vectorFeature = new VectorFeature(point, style);
	vectorFeature.setFeatureId("P" + (++featureIdSequence));
	return vectorFeature;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:39,代码来源:OpenStreetMapWorldMap.java

示例7: movePin

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void movePin(VectorFeature pin, double latitude, double longitude) {
	final LonLat lonLat = new LonLat(longitude, latitude);
	lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
	
	pin.move(lonLat);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:OpenStreetMapWorldMap.java

示例8: panTo

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
public void panTo(double latitude, double longitude) {
	final LonLat lonLat = new LonLat(longitude, latitude);
	lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
	
	mapWidget.getMap().setCenter(lonLat);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:OpenStreetMapWorldMap.java

示例9: centerMap

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
public void centerMap(final double lon, final double lat, final String sourceProjection, final String targetProjection){
	final LonLat lonLat = new LonLat(lon, lat);
	lonLat.transform(sourceProjection, targetProjection);
	
	getMap().setCenter(lonLat, 5);		
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:7,代码来源:GeoMap.java

示例10: transformToWGS84

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat transformToWGS84(final LonLat lonLat) {
	lonLat.transform(geoMap.getMap().getProjection(), "EPSG:4326");
	return lonLat;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:5,代码来源:CurrentExtentTool.java

示例11: transformToInternalProjection

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private void transformToInternalProjection(final LonLat lonLat, String epsg) {
	if (!epsg.equals(geoMap.getMap().getProjection())) {
		lonLat.transform(epsg, geoMap.getMap().getProjection());
	}
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:6,代码来源:GeocodingPanelWidget.java

示例12: convertLonLat

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat convertLonLat(Wgs84LatLonBean latLon) {
	LonLat lonLat = new LonLat(latLon.getLon(), latLon.getLat());
	lonLat.transform(WGS84_PROJECTION.getProjectionCode(),
			mapProjection.getProjectionCode());
	return lonLat;
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:7,代码来源:OpenLayersItinerary.java

示例13: convertLatLng

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private Wgs84LatLonBean convertLatLng(LonLat lonLat) {
	LonLat lonLat2 = new LonLat(lonLat.lon(), lonLat.lat());
	lonLat2.transform(mapProjection.getProjectionCode(),
			WGS84_PROJECTION.getProjectionCode());
	return new Wgs84LatLonBean(lonLat2.lat(), lonLat2.lon());
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:7,代码来源:OpenLayersPlannerMapWidget.java

示例14: convertLonLat

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat convertLonLat(Wgs84LatLonBean latLon) {
	LonLat lonLat = new LonLat(latLon.getLon(), latLon.getLat());
	lonLat.transform(WGS84_PROJECTION.getProjectionCode(),
			mapProjectionCode);
	return lonLat;
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:7,代码来源:OpenLayersPOILayer.java

示例15: toLonLat

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private static LonLat toLonLat(final GWTLatLng latLng) {
    final LonLat ll = new LonLat(latLng.getLongitude(), latLng.getLatitude());
    ll.transform(PROJECTION_LAT_LON.getProjectionCode(), PROJECTION_SPHERICAL_MERCATOR.getProjectionCode());
    return ll;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:6,代码来源:OpenLayersMapPanel.java


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