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


Java OsmMercator类代码示例

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


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

示例1: tileYToLat

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
private double tileYToLat(double y, int zoom) {
    double lat0;
    double lat = cachedLat;
    do {
        lat0 = lat;
        lat = lat - Math.toDegrees(nextTerm(Math.toRadians(lat), y, zoom));
        if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) {
            Random r = new Random();
            lat = OsmMercator.MIN_LAT +
              r.nextInt((int) (OsmMercator.MAX_LAT - OsmMercator.MIN_LAT));
        }
    } while (Math.abs(lat0 - lat) > 0.000001);

    cachedLat = lat;

    return lat;
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:18,代码来源:ScanexTileSource.java

示例2: getValueAt

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
public Object getValueAt(int pRowIndex, int pColumnIndex) {
	final Place place = getPlace(pRowIndex);
	switch (pColumnIndex) {
	case SEARCH_DISTANCE_COLUMN:
		final double value = OsmMercator.getDistance(
				mCursorCoordinate.getLat(), mCursorCoordinate.getLon(),
				place.getLat(), place.getLon()) / 1000.0;
		if (Double.isInfinite(value) || Double.isNaN(value)) {
			return Double.valueOf(-1.0);
		}
		return new Double(value);
	case SEARCH_DESCRIPTION_COLUMN:
		return place.getDisplayName();
	}
	return null;
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:17,代码来源:MapDialog.java

示例3: tileYToLat

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
private double tileYToLat(double y, int zoom) {
    double lat0, lat;

    lat = cached_lat;
    do {
        lat0 = lat;
        lat = lat - Math.toDegrees(NextTerm(Math.toRadians(lat), y, zoom));
        if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) {
            Random r = new Random();
            lat = OsmMercator.MIN_LAT +
              r.nextInt((int )(OsmMercator.MAX_LAT - OsmMercator.MIN_LAT));
        }
    } while ((Math.abs(lat0 - lat) > 0.000001));

    cached_lat = lat;

    return (lat);
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:19,代码来源:ScanexTileSource.java

示例4: TMSTileSource

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
/**
 * Constructs a new {@code TMSTileSource}.
 * @param info tile source information
 */
public TMSTileSource(TileSourceInfo info) {
    super(info);
    minZoom = info.getMinZoom();
    maxZoom = info.getMaxZoom();
    this.osmMercator = new OsmMercator(this.getTileSize());
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:11,代码来源:TMSTileSource.java

示例5: destinationQuadrantCheck

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
public boolean destinationQuadrantCheck(Coordinate cursorPosition,
		Coordinate pointPosition, boolean alternative) {
	int mapZoomMax = getMaxZoom();
	int x1 = OsmMercator.LonToX(cursorPosition.getLon(), mapZoomMax);
	int y1 = OsmMercator.LatToY(cursorPosition.getLat(), mapZoomMax);
	int x2 = OsmMercator.LonToX(pointPosition.getLon(), mapZoomMax);
	int y2 = OsmMercator.LatToY(pointPosition.getLat(), mapZoomMax);
	return destinationQuadrantCheck(x1, y1, x2, y2, alternative);
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:10,代码来源:FreeMindMapController.java

示例6: actionPerformed

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
public void actionPerformed(ActionEvent pE) {
	String statusText = "";
	// here, we look wether or not the cursor is above a node.
	MapMarkerBase mapMarker = checkHit(mTimerMouseEvent);
	if (mapMarker instanceof MapMarkerLocation) {
		MapNodePositionHolder posHolder = ((MapMarkerLocation) mapMarker)
				.getNodePositionHolder();

		logger.fine("Looking for hit on node " + posHolder);
		if (posHolder != null) {
			statusText = Tools.getNodeTextHierarchy(posHolder.getNode(),
					mMapHook.getMindMapController()) + ". ";
		}
	}
	// calculate the distance to the cursor
	Coordinate coordinate = getCoordinateFromMouseEvent(mTimerMouseEvent);
	Coordinate cursorPosition = getMap().getCursorPosition();
	double distance = OsmMercator.getDistance(coordinate.getLat(),
			coordinate.getLon(), cursorPosition.getLat(),
			cursorPosition.getLon()) / 1000.0;
	Object[] messageArguments = { new Double(distance),
			new Double(coordinate.getLat()),
			new Double(coordinate.getLon()) };
	MessageFormat formatter = new MessageFormat(
			mMindMapController.getText("plugins/map/MapDialog_Distance"));
	String message = formatter.format(messageArguments);
	statusText += message;
	mMapHook.getStatusLabel().setText(statusText);
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:30,代码来源:FreeMindMapController.java

示例7: getDefaultTileSize

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
/**
 * @return default tile size to use, when not set in Imagery Preferences
 */
@Override
public int getDefaultTileSize() {
    return OsmMercator.DEFAUL_TILE_SIZE;
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:8,代码来源:AbstractTMSTileSource.java

示例8: getImageForTooltip

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
/**
 * @param pPosition
 * @param pTileSource
 */
public TileImage getImageForTooltip(Coordinate pPosition, int pZoom,
		String pTileSource) {
	TileSource tileSource = FreeMindMapController.changeTileSource(
			pTileSource, null);
	if (tileSource != null) {
		mTileSource = tileSource;
		mTileController.setTileSource(tileSource);
	}
	int tileSize = mTileSource.getTileSize();
	int exactx = OsmMercator.LonToX(pPosition.getLon(), pZoom);
	int exacty = OsmMercator.LatToY(pPosition.getLat(), pZoom);
	int x = exactx / tileSize;
	int y = exacty / tileSize;
	// determine other surrounding tiles that are close to the exact
	// point.
	int dx = exactx % tileSize;
	int dy = exacty % tileSize;
	// determine quadrant of cursor in tile:
	if (dx < tileSize / 2) {
		x -= 1;
		dx += tileSize;
	}
	if (dy < tileSize / 2) {
		y -= 1;
		dy += tileSize;
	}
	TileImage tileImage = new TileImage();
	tileImage.setTiles(2, x, y, pZoom, mTileController, logger, dx, dy);
	// wait for tiles:
	int timeout = 60;
	while (timeout-- > 0) {
		try {
			if (tileImage.isLoaded() || tileImage.hasErrors()) {
				break;
			}
			Thread.sleep(100);
		} catch (Exception e) {
			freemind.main.Resources.getInstance().logException(e);
		}
	}
	return tileImage;
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:47,代码来源:Registration.java

示例9: getDistance

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public double getDistance(final double lat1, final double lon1, final double lat2, final double lon2) {
    return OsmMercator.getDistance(lat1, lon1, lat2, lon2);
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:5,代码来源:TileStoreTileSource.java

示例10: LonToX

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public int LonToX(final double lon, final int zoom) {
    return (int )OsmMercator.LonToX(lon, zoom);
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:5,代码来源:TileStoreTileSource.java

示例11: LatToY

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public int LatToY(final double lat, final int zoom) {
    return (int )OsmMercator.LatToY(lat, zoom);
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:5,代码来源:TileStoreTileSource.java

示例12: XToLon

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public double XToLon(final int x, final int zoom) {
    return OsmMercator.XToLon(x, zoom);
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:5,代码来源:TileStoreTileSource.java

示例13: YToLat

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public double YToLat(final int y, final int zoom) {
    return OsmMercator.YToLat(y, zoom);
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:5,代码来源:TileStoreTileSource.java

示例14: latLonToViz

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
public static Point2D latLonToViz(Point2D p) {
	return new Point2D.Double(new OsmMercator().lonToX(p.getY(), 0), new OsmMercator().latToY(p.getX(), 0));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:4,代码来源:GisUtils.java

示例15: LatToY

import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入依赖的package包/类
@Override
public int LatToY(double lat, int zoom) {
    return (int )(latToTileY(lat, zoom) * OsmMercator.TILE_SIZE);
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:ScanexTileSource.java


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