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

Java LonLat类代码示例

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

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



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

示例1: onRelease

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


示例2: 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


示例3: 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


示例4: onClick

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void onClick(MapClickEvent mapClickEvent) {
	if (tool.equals("px") || tool.equals("py")) {
		if (drawButton.isDown()) {
			LonLat click = mapClickEvent.getLonLat();
			if (tool.equals("py")) {
				setCurrentSelection(getYlo(), getYhi(), click.lon(),
						click.lon());
				eventBus.fireEventFromSource(new MapChangeEvent(
						getYlo(), getYhi(), click.lon(), click.lon()),
						this);
			} else if (tool.equals("px")) {
				setCurrentSelection(click.lat(), click.lat(), getXlo(),
						getXhi());
				eventBus.fireEventFromSource(
						new MapChangeEvent(click.lat(), click.lat(),
								getXlo(), getXhi()), this);
			}
		}
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:22,代码来源:OLMapWidget.java


示例5: addMapControls

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
protected void addMapControls(MapOptions mapOptions) {
    super.addMapControls(mapOptions);
    MousePositionOptions options = new MousePositionOptions();
    options.setFormatOutput(new MousePositionOutput() {
        
        @Override
        public String format(LonLat lonLat, Map map) {
            lonLat.transform(getMapProjection(), EPSG_4326);
            StringBuilder sb = new StringBuilder();
            sb.append("Lon: ").append(lonLat.lon()).append(", ");
            sb.append("Lat: ").append(lonLat.lat());
            sb.append(" (").append(map.getProjection()).append(")");
            return sb.toString();
            
        }
    });
    map.addControl(new MousePosition(options));
}
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:20,代码来源:StationSelectorMap.java


示例6: createVectorFeature

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
private VectorFeature createVectorFeature(final LonLat lonlat, final String words) {
	final Point point = new Point(lonlat.lon(), lonlat.lat());
	final VectorFeature pointFeature = new VectorFeature(point);

	final Attributes attributes = new Attributes();
	attributes.setAttribute("X", String.valueOf(lonlat.lon()));
	attributes.setAttribute("Y", String.valueOf(lonlat.lat()));
	attributes.setAttribute("w3w", words);
	pointFeature.setAttributes(attributes);

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


示例7: updateMap

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void updateMap(final double lat, final double lon, final int zoom, String epsg) {
	finishProgressBar();
	final LonLat lonLat = new LonLat(lon, lat);
	transformToInternalProjection(lonLat, epsg);
	geoMap.getMap().panTo(lonLat);
	geoMap.getMap().setCenter(lonLat, zoom);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:8,代码来源:GeocodingPanelWidget.java


示例8: setCurrentCoordinate

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void setCurrentCoordinate(LonLat currentCoordinate) {
	StatusItem lonItem = getStatusItem(LON_LABEL);
	lonItem.setValue(Double.toString(currentCoordinate.lon()));
	StatusItem latItem = getStatusItem(LAT_LABEL);
	latItem.setValue(Double.toString(currentCoordinate.lat()));

	statusStore.update(lonItem);
	statusStore.update(latItem);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:StatusPanelWidget.java


示例9: resizeMap

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void resizeMap() {
	// Do a meaningless little calculation to force the map to re-calibrate
	// where it is on the page.
	int zoom = map.getZoom();
	LonLat center = map.getCenter();
	map.setCenter(center, zoom);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:OLMapWidget.java


示例10: onMapMove

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


示例11: getCenterLatLon

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public double[] getCenterLatLon() {
	LonLat centerLonLat = map.getCenter();
	double[] center = new double[2];
	center[0] = centerLonLat.lat();
	center[1] = centerLonLat.lon();
	return center;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:OLMapWidget.java


示例12: updateDeparturePosition

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void updateDeparturePosition(Wgs84LatLonBean departurePosition,
		boolean autoPan) {
	if (departurePosition == null) {
		departureWaypoint.hide();
	} else {
		LonLat lonLat = convertLonLat(departurePosition);
		departureWaypoint.moveTo(lonLat);
		if (autoPan)
			map.panTo(lonLat);
	}
	waypointLayer.redraw();
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:14,代码来源:OpenLayersPlannerMapWidget.java


示例13: updateArrivalPosition

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void updateArrivalPosition(Wgs84LatLonBean arrivalPosition,
		boolean autoPan) {
	if (arrivalPosition == null) {
		arrivalWaypoint.hide();
	} else {
		LonLat lonLat = convertLonLat(arrivalPosition);
		arrivalWaypoint.moveTo(lonLat);
		if (autoPan)
			map.panTo(lonLat);
	}
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:13,代码来源:OpenLayersPlannerMapWidget.java


示例14: handleClickOnMap

import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
private void handleClickOnMap(LonLat lonLat, Pixel pixel) {
	if (popupMenu.isShowing()) {
		hidePopupMenu();
		return;
	}
	popupMarker.moveTo(lonLat);
	popupMenuPosition = lonLat;
	popupMenu.setPopupPosition(this.getAbsoluteLeft() + pixel.x() + 2,
			this.getAbsoluteTop() + pixel.y() + 2);
	popupMenu.show();
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:12,代码来源:OpenLayersPlannerMapWidget.java


示例15: printContacts

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


示例16: PlotPointsRuskin

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


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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