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


Java Point类代码示例

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


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

示例1: OLTimeSeriesMap

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
/**
 * 
 */
public OLTimeSeriesMap() {
	
	Point center = new Point(0.0, 0.0);
	mapWidget = new OLMapWidget( "350px", "520px");
	map = mapWidget.getMap();
	map.addLayer(pointsLayer);
	layout_grid.setWidget(0, 0, reset);
	layout_grid.setWidget(0, 1, select);
	FlexCellFormatter formatter = layout_grid.getFlexCellFormatter();
	formatter.addStyleName(0, 1, "right-small-banner");
	select.addStyleName("right-small-banner");
	layout_grid.setWidget(1, 0, mapWidget);
	formatter.setColSpan(1, 0, 2);
	reset.addClickListener(resetListener);
	initWidget(layout_grid);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:OLTimeSeriesMap.java

示例2: createVectorFeature

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

示例3: show

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
public void show() {
	if (position == null)
		return;
	Point point = new Point(position.lon(), position.lat());
	vectorFeature = createFeatureFromImageResource(imageResource,
			new Pixel(-10, -39), point, opacity);
	vectorFeature.getAttributes().setAttribute(
			OpenLayersPlannerMapWidget.WAYPOINT_TYPE_KEY, name);
	vectorFeature.getAttributes().setAttribute(
			OpenLayersPlannerMapWidget.WAYPOINT_DRAGGABLE_KEY, draggable);
	layer.addFeature(vectorFeature);
	layer.redraw();
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:14,代码来源:OpenLayersWaypoint.java

示例4: createFeatureFromImageResource

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
private VectorFeature createFeatureFromImageResource(
		ImageResource imageResource, Pixel anchor, Point position,
		double opacity) {
	Style pointStyle = new Style();
	pointStyle.setExternalGraphic(imageResource.getSafeUri().asString());
	pointStyle.setGraphicSize(imageResource.getWidth(),
			imageResource.getHeight());
	pointStyle.setGraphicOffset(anchor.x(), anchor.y());
	pointStyle.setFillOpacity(1.0 * opacity);
	pointStyle.setStrokeOpacity(1.0 * opacity);
	VectorFeature retval = new VectorFeature(position, pointStyle);
	return retval;
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:14,代码来源:OpenLayersWaypoint.java

示例5: printContacts

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

示例6: PlotPointDiary

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

示例7: PlotPointsRuskin

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

示例8: createNativePin

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

示例9: createLastPointRegisterLayer

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
private void createLastPointRegisterLayer(VehicleJSO vehicleJSO,
		PointRegisterJSO point) {
	VectorLayerConfig layerConfig = createVectorLayerConfig(vehicleJSO);

	VectorLayer vehicleLayer = (VectorLayer) layerManagerWidget
			.getVector(LAYER_NAME);
	if (vehicleLayer == null) {
		vehicleLayer = createEmptyPointRegisterLayer(layerConfig);
		vehicleLayer.setStyleMap(getStyleMap());
		layerManagerWidget.addVector(vehicleLayer);
	}
	else {
		removeLastPoint(vehicleLayer, vehicleJSO.getPlate());
	}
	
	WKT reader = new WKT();

	VectorFeature f = reader.read(point.getPosition())[0];

	Geometry g = f.getGeometry();
	Point currentPoint = Point.narrowToPoint(g.getJSObject());
	String position = "lon: " + currentPoint.getX() + " lat: "
			+ currentPoint.getY();

	f.getGeometry().transform(layerConfig.getProjection(),
			layerConfig.getDefaultProjection());

	vehicleLayer.addFeature(f);

	f.getAttributes().setAttribute(NAME, vehicleJSO.getName());
	f.getAttributes().setAttribute(PLATE, vehicleJSO.getPlate());
	f.getAttributes().setAttribute(DATE, getDateAsString(point.getDate()));
	f.getAttributes().setAttribute(TIME, getTimeAsString(point.getDate()));
	f.getAttributes().setAttribute(POSITION, position);
	f.getAttributes().setAttribute(STREET, point.getStreet());
	f.getAttributes().setAttribute(NUMBER, point.getNumber());
	f.getAttributes().setAttribute(LOCALITY, point.getLocality());
	f.getAttributes().setAttribute(PROVINCE, point.getProvince());
	f.getAttributes().setAttribute(POSTAL_CODE, point.getPostalCode());
	f.getAttributes().setAttribute(COUNTRY, point.getCountry());

	String active = "NO";
	if("ACTIVE".equals(vehicleJSO.getStatus())) {
		active = UISgfMessages.INSTANCE.yesValue();
	}
	f.getAttributes().setAttribute(ACTIVE, active);

	f.getAttributes().setAttribute(STATUS, getStatus(point.getDatos())); //PARADA/MARCHA

	layerManagerWidget.setSelectedLayer(LayerManagerWidget.VECTOR_TAB,
			vehicleLayer);
	
	g = f.getGeometry();
	currentPoint = Point.narrowToPoint(g.getJSObject());
	final LonLat lonLat = new LonLat(currentPoint.getX(), currentPoint.getY());
	geoMap.getMap().panTo(lonLat);
	geoMap.getMap().setCenter(lonLat, 20);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:59,代码来源:LastPointRegisterVehicleTool.java

示例10: getPoint

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
private Point getPoint(String coordX, String coordY) {
	return new Point(Double.valueOf(coordX), Double.valueOf(coordY));
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:4,代码来源:CSV.java

示例11: createFeatureFromMode

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的package包/类
private VectorFeature createFeatureFromMode(TransportMode mode,
		boolean leftish, Point position, double opacity) {
	ImageResource imageResource;
	switch (mode) {
	case WALK:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplWalkPng()
				: PlannerResources.INSTANCE.modemaprWalkPng();
		break;
	case BICYCLE:
	case BICYCLE_RENTAL: // TODO Make dedicated icon
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplBicyclePng()
				: PlannerResources.INSTANCE.modemaprBicyclePng();
		break;
	case BUS:
		imageResource = leftish ? PlannerResources.INSTANCE.modemaplBusPng()
				: PlannerResources.INSTANCE.modemaprBusPng();
		break;
	case CAR:
		imageResource = leftish ? PlannerResources.INSTANCE.modemaplCarPng()
				: PlannerResources.INSTANCE.modemaprCarPng();
		break;
	case FERRY:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplFerryPng()
				: PlannerResources.INSTANCE.modemaprFerryPng();
		break;
	case GONDOLA:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplGondolaPng()
				: PlannerResources.INSTANCE.modemaprGondolaPng();
		break;
	case PLANE:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplPlanePng()
				: PlannerResources.INSTANCE.modemaprPlanePng();
		break;
	case RAIL:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplRailPng()
				: PlannerResources.INSTANCE.modemaprRailPng();
		break;
	case SUBWAY:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplSubwayPng()
				: PlannerResources.INSTANCE.modemaprSubwayPng();
		break;
	case TRAM:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplTramPng()
				: PlannerResources.INSTANCE.modemaprTramPng();
		break;
	case TROLLEY:
		imageResource = leftish
				? PlannerResources.INSTANCE.modemaplTrolleyPng()
				: PlannerResources.INSTANCE.modemaprTrolleyPng();
		break;
	default:
		return null;
	}
	Style pointStyle = new Style();
	pointStyle.setExternalGraphic(imageResource.getSafeUri().asString());
	pointStyle.setGraphicSize(imageResource.getWidth(),
			imageResource.getHeight());
	Pixel anchor = leftish ? new Pixel(-34, -34) : new Pixel(0, -34);
	pointStyle.setGraphicOffset(anchor.x(), anchor.y());
	pointStyle.setFillOpacity(1.0 * opacity);
	pointStyle.setStrokeOpacity(1.0 * opacity);
	VectorFeature retval = new VectorFeature(position, pointStyle);
	retval.getAttributes().setAttribute(
			OpenLayersPlannerMapWidget.WAYPOINT_DRAGGABLE_KEY, false);
	return retval;
}
 
开发者ID:mecatran,项目名称:OpenTripPlanner-client-gwt,代码行数:75,代码来源:OpenLayersItinerary.java

示例12: updatePOIList

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

示例13: PlotPointAll

import org.gwtopenmaps.openlayers.client.geometry.Point; //导入依赖的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.geometry.Point类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。