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


Java OsmMercator.LatToY方法代码示例

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


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

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

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

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

示例4: LatToY

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

示例5: latToTileY

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


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