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


Java LonLat.lat方法代码示例

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


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

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

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

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

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

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

示例7: updatePOIList

import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
public void updatePOIList(String sourceId,
		java.util.Map<String, POIBean> pois) {
	// Remove only POI coming from the same sourceId
	if (layer.getFeatures() != null) {
		for (VectorFeature feature : layer.getFeatures()) {
			String poiSource = feature.getAttributes()
					.getAttributeAsString("sourceId");
			if (poiSource.equals(sourceId))
				layer.removeFeature(feature);
		}
	}
	// Order POI on z-index = latitude
	List<POIBean> poiList = new ArrayList<POIBean>(pois.values());
	Collections.sort(poiList, new Comparator<POIBean>() {
		@Override
		public int compare(POIBean o1, POIBean o2) {
			double delta = o2.getLocation().getLat()
					- o1.getLocation().getLat();
			return delta < 0.0 ? -1 : +1;
		}
	});
	for (POIBean poi : poiList) {
		ImageResource imageResource = POIUtils.getPoiIcon(poi.getType());
		String imageUrl = imageResource.getSafeUri().asString();

		Style pointStyle = new Style();
		pointStyle.setExternalGraphic(imageUrl);
		pointStyle.setGraphicSize(imageResource.getWidth(),
				imageResource.getHeight());
		// HACK ALERT! Assume all POI icons the same size.
		Pixel anchor = new Pixel(-12, -30);
		pointStyle.setGraphicOffset(anchor.x(), anchor.y());
		pointStyle.setFillOpacity(1.0);
		pointStyle.setStrokeOpacity(1.0);
		LonLat position = convertLonLat(poi.getLocation());
		Point point = new Point(position.lon(), position.lat());
		VectorFeature marker = new VectorFeature(point, pointStyle);
		// TODO Set POI name as <h3>title</h3>?
		marker.getAttributes().setAttribute(
				OpenLayersPlannerMapWidget.POPUP_CONTENT_KEY,
				poi.getHtmlDescription());
		marker.getAttributes().setAttribute(
				OpenLayersPlannerMapWidget.POPUP_CLASS_KEY, "poi-popup");
		layer.addFeature(marker);
	}
	layer.setDisplayInLayerSwitcher(!poiList.isEmpty());
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:48,代码来源:OpenLayersPOILayer.java


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