本文整理汇总了Java中org.openstreetmap.gui.jmapviewer.OsmMercator.getDistance方法的典型用法代码示例。如果您正苦于以下问题:Java OsmMercator.getDistance方法的具体用法?Java OsmMercator.getDistance怎么用?Java OsmMercator.getDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openstreetmap.gui.jmapviewer.OsmMercator
的用法示例。
在下文中一共展示了OsmMercator.getDistance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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);
}
示例4: getDistance
import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入方法依赖的package包/类
@Override
public double getDistance(double lat1, double lon1, double lat2, double lon2) {
return OsmMercator.getDistance(lat1, lon1, lat2, lon2);
}
示例5: dist
import org.openstreetmap.gui.jmapviewer.OsmMercator; //导入方法依赖的package包/类
/**
* @param pPosition
* @param pCursorPosition
* @return
*/
private double dist(Coordinate p1, Coordinate p2) {
return OsmMercator.getDistance(p1.getLat(), p1.getLon(),
p2.getLat(), p2.getLon());
}