本文整理汇总了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);
}
示例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;
}
示例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);
}
示例4: LatToY
import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入方法依赖的package包/类
@Override
public int LatToY(double lat, int zoom) {
return (int )OsmMercator.LatToY(lat, zoom);
}
示例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;
}