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


Java LatLon类代码示例

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


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

示例1: doZoom

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
public void doZoom(Point2D p, double factor) {
	LatLon dest = new LatLon(Angle.fromDegrees(p.getY()), Angle.fromDegrees(p.getX()));
	double wwzoom = 2785 * Math.pow(factor, -.8311) * 10000;

	final OrbitView view = (OrbitView) wwd.getView();

	FlyToOrbitViewAnimator fto = 
		FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
			view,
			view.getCenterPosition(), new Position(dest, 0),
			view.getHeading(), Angle.fromDegrees(0),
			view.getPitch(), Angle.fromDegrees(0),
			view.getZoom(), wwzoom,
			5000, WorldWind.CONSTANT); //was true

	view.addAnimator(fto);

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			((MapApp)getApp()).getFrame().toFront();
			view.firePropertyChange(AVKey.VIEW,  null, view);
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMap.java

示例2: makeLevels

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
	AVList params = new AVListImpl();
	
	params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
	params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
	params.setValue(AVKey.DATA_CACHE_NAME, "scs_tracks");
	params.setValue(AVKey.SERVICE, "null");
	params.setValue(AVKey.DATASET_NAME, "scs_tracks");
	params.setValue(AVKey.FORMAT_SUFFIX, "null");
	params.setValue(AVKey.NUM_LEVELS, numLevels);
	params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
	params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
	params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
	
	return new LevelSet(params);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:SCSTileLayer.java

示例3: makeCruiseAreas

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
protected void makeCruiseAreas() {
	for (XMCruise cruise : cruises)
	{
		Rectangle2D bounds = cruise.getBounds();
		double x0 = bounds.getMinX();
		double x1 = bounds.getMaxX();
		double y0 = bounds.getMinY();
		double y1 = bounds.getMaxY();
		
		double[] points = new double[] { x0, y0, x0, y1, x1, y1, x1, y0 };

		List<LatLon> pos = new LinkedList<LatLon>();
		for (int i = 0; i < 10; i += 2) {
			pos.add(
				LatLon.fromDegrees(
						points[(i + 1) % 8],
						points[i % 8] ));
		}

		Polyline line = new Polyline(pos, 0);
		line.setFollowTerrain( true );
		line.setLineWidth(2);
		tracklayer.addRenderable(line);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:26,代码来源:WWXMCS.java

示例4: makeLevels

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels, String name) {
	AVList params = new AVListImpl();
	
	params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
	params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
	params.setValue(AVKey.DATA_CACHE_NAME, "mgg_" + name);
	params.setValue(AVKey.SERVICE, "null");
	params.setValue(AVKey.DATASET_NAME, "mgg_" + name);
	params.setValue(AVKey.FORMAT_SUFFIX, "null");
	params.setValue(AVKey.NUM_LEVELS, numLevels);
	params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
	params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
	params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
	
	return new LevelSet(params);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:MGGTileLayer.java

示例5: makeLevels

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
	AVList params = new AVListImpl();
	
	params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
	params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
	params.setValue(AVKey.DATA_CACHE_NAME, "mb_tracks");
	params.setValue(AVKey.SERVICE, "null");
	params.setValue(AVKey.DATASET_NAME, "mb_tracks");
	params.setValue(AVKey.FORMAT_SUFFIX, "null");
	params.setValue(AVKey.NUM_LEVELS, numLevels);
	params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
	params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
	params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
	
	return new LevelSet(params);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:MBTileLayer.java

示例6: makeLevels

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
	AVList params = new AVListImpl();
	
	params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
	params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
	params.setValue(AVKey.DATA_CACHE_NAME, "null");
	params.setValue(AVKey.SERVICE, "null");
	params.setValue(AVKey.DATASET_NAME, "grid");
	params.setValue(AVKey.FORMAT_SUFFIX, "null");
	params.setValue(AVKey.NUM_LEVELS, numLevels);
	params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
	params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
	params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
	
	   return new LevelSet(params);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:GridTileLayer.java

示例7: setFallbacks

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
protected static void setFallbacks(AVList params)
{
	if (params.getValue(AVKey.LEVEL_ZERO_TILE_DELTA) == null)
	{
		Angle delta = Angle.fromDegrees(36);
		params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(delta, delta));
	}

	if (params.getValue(AVKey.TILE_WIDTH) == null)
		params.setValue(AVKey.TILE_WIDTH, 512);

	if (params.getValue(AVKey.TILE_HEIGHT) == null)
		params.setValue(AVKey.TILE_HEIGHT, 512);

	if (params.getValue(AVKey.FORMAT_SUFFIX) == null)
		params.setValue(AVKey.FORMAT_SUFFIX, ".dds");

	if (params.getValue(AVKey.NUM_LEVELS) == null)
		params.setValue(AVKey.NUM_LEVELS, 19); // approximately 0.1 meters per pixel

	if (params.getValue(AVKey.NUM_EMPTY_LEVELS) == null)
		params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:BasicScalingTiledImageLayer.java

示例8: getRestorableStateForAVPair

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
public void getRestorableStateForAVPair(String key, Object value,
    RestorableSupport rs, RestorableSupport.StateObject context)
{
    if (value == null)
        return;

    if (key.equals(AVKey.CONSTRUCTION_PARAMETERS))
        return;

    if (value instanceof LatLon)
    {
        rs.addStateValueAsLatLon(context, key, (LatLon) value);
    }
    else if (value instanceof Sector)
    {
        rs.addStateValueAsSector(context, key, (Sector) value);
    }
    else if (value instanceof Color)
    {
        rs.addStateValueAsColor(context, key, (Color) value);
    }
    else
    {
        super.getRestorableStateForAVPair(key, value, rs, context);
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:BasicScalingTiledImageLayer.java

示例9: getSamples

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private LatLon[] getSamples(DrawContext dc) {
	Rectangle rec = dc.getView().getViewport();
	Position upperLeft = scanForPosition(dc,0,0);
	Position upperRight = scanForPosition(dc,rec.width,0);
	Position lowerLeft = scanForPosition(dc,0,rec.height);
	Position lowerRight = scanForPosition(dc,rec.width,rec.height);
	Position middleTop = scanForPosition(dc,rec.width/2,0);
	Position middleBottom = scanForPosition(dc,rec.width/2,rec.height);
	Position middleUpThird = scanForPosition(dc,rec.width/2,rec.height/3);
	Position middle = scanForPosition(dc,rec.width/2,rec.height/2-1);
	
	return new LatLon[]{
		upperLeft,
		upperRight,
		lowerLeft,
		lowerRight,
		middleTop,
		middleBottom,
		middleUpThird,
		middle
	};
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:23,代码来源:WWSceneGraph.java

示例10: initializeCrossline

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private void initializeCrossline(DrawContext dc) {
	DoubleBuffer verts = crossLine;

	if (verts == null)
		verts = Buffers.newDirectDoubleBuffer(points.size() * 3);

	for (LatLon point : points)
	{
		double alt = 
			elevation + baseHeight * exageration * (yMax - yMin) * crossLinePercent;
		
		Vec4 p1 =
			dc.getGlobe().computePointFromPosition(point.getLatitude(), point.getLongitude(), alt);

		verts.put(p1.x - referenceCenter.x);
		verts.put(p1.y - referenceCenter.y);
		verts.put(p1.z - referenceCenter.z);
	}
	
	this.crossLine = verts;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:22,代码来源:FenceDiagram.java

示例11: parseCoordinates

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private PointOfInterest parseCoordinates(String coords[])
{
    if (isDecimalDegrees(coords))
    {
        Double d1 = Double.parseDouble(coords[0].trim());
        Double d2 = Double.parseDouble(coords[1].trim());

        return new BasicPointOfInterest(LatLon.fromDegrees(d1, d2));
    }
    else //may be in DMS
    {
        Angle aLat = Angle.fromDMS(coords[0].trim());
        Angle aLon = Angle.fromDMS(coords[1].trim());

        return new BasicPointOfInterest(LatLon.fromDegrees(aLat.getDegrees(), aLon.getDegrees()));
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:18,代码来源:TellervoGazetteerPanel.java

示例12: setAnnotationPosition

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private void setAnnotationPosition(	final TrackPointAnnotation sliderAnnotation,
									final TourData tourData,
									final int positionIndex) {

	final double[] latitudeSerie = tourData.latitudeSerie;
	final double[] longitudeSerie = tourData.longitudeSerie;

	final double latitude = latitudeSerie[positionIndex];
	final double longitude = longitudeSerie[positionIndex];

	final float[] altitudeSerie = tourData.altitudeSerie;
	final float trackAltitude = altitudeSerie == null ? 0 : altitudeSerie[positionIndex];

	final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();

	final LatLon latLon = new LatLon(//
			Angle.fromDegrees(latitude),
			Angle.fromDegrees(longitude));

	sliderAnnotation.latLon = latLon;
	sliderAnnotation.trackAltitude = trackAltitude;

	sliderAnnotation.setAltitudeMode(config.altitudeMode);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:25,代码来源:Map3View.java

示例13: jButton6ActionPerformed

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton6ActionPerformed
{//GEN-HEADEREND:event_jButton6ActionPerformed
    LocationSearchDialog dialog = new LocationSearchDialog(this, true);
    dialog.setLocationRelativeTo(this);
    dialog.setVisible(true);

    // get results
    if(dialog.isLocationSelected())
    {
        LatLon ll = dialog.getLocLatLon();
        destLatTextField.setText(ll.getLatitude().getDegrees()+""); // .toDecimalDegreesString(8)
        destLonTextField.setText(ll.getLongitude().getDegrees()+"");
        //setDestLocationButton.doClick(); // set location
        destLatLon = ll;
        destinationMarker.setPosition( new Position(destLatLon.getLatitude(), destLatLon.getLongitude(), 0.0) );
        useDestinationCheckBox.setSelected(true); // auto select
        manageDestinationObjects();
    }
    
}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:21,代码来源:GpsInspector.java

示例14: setDestLocationButtonActionPerformed

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private void setDestLocationButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_setDestLocationButtonActionPerformed
{//GEN-HEADEREND:event_setDestLocationButtonActionPerformed
    try
    {
        destLatLon = new LatLon(Angle.fromDegrees(Double.parseDouble(destLatTextField.getText())),Angle.fromDegrees(Double.parseDouble(destLonTextField.getText())) );
        destinationMarker.setPosition( new Position(destLatLon.getLatitude(), destLatLon.getLongitude(), 0.0) );
        useDestinationCheckBox.setSelected(true);
        manageDestinationObjects();
        //System.out.println("here" + destLatLon.toString());
    }
    catch(Exception e)
    {
        JOptionPane.showMessageDialog(this, "Data Error: \n" + e.toString(), "Data Error",JOptionPane.ERROR_MESSAGE);
    }

}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:17,代码来源:GpsInspector.java

示例15: setDestinationButtonActionPerformed

import gov.nasa.worldwind.geom.LatLon; //导入依赖的package包/类
private void setDestinationButtonActionPerformed(java.awt.event.ActionEvent evt)
{
	//System.out.println(wwd.getCurrentPosition().latitude.toString());
	
	Position position = (Position) waypoint_list.getSelectedValue();
	System.out.println(position.toString());
	
	destLatTextField.setText("" + position.latitude.degrees);
	destLonTextField.setText("" + position.longitude.degrees);
    destLatLon = new LatLon(Angle.fromDegrees(Double.parseDouble(destLatTextField.getText())), 
    		Angle.fromDegrees(Double.parseDouble(destLonTextField.getText())) );

	
   // destinationMarker.setPosition( new Position(position.getLatitude(), position.getLongitude(), 0.0) );
    useDestinationCheckBox.setSelected(true);
    manageDestinationObjects();
	
}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:19,代码来源:GpsInspector.java


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