本文整理汇总了Java中org.oscim.core.MercatorProjection.groundResolution方法的典型用法代码示例。如果您正苦于以下问题:Java MercatorProjection.groundResolution方法的具体用法?Java MercatorProjection.groundResolution怎么用?Java MercatorProjection.groundResolution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscim.core.MercatorProjection
的用法示例。
在下文中一共展示了MercatorProjection.groundResolution方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTile
import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
private void initTile(MapTile tile) {
double lat = MercatorProjection.toLatitude(tile.y);
mGroundScale = (float) MercatorProjection
.groundResolution(lat, 1 << mTile.zoomLevel);
mRoofs = new ExtrusionBucket(0, mGroundScale, Color.get(247, 249, 250));
mParts = new ExtrusionBucket(0, mGroundScale, Color.get(255, 254, 252));
//mRoofs = new ExtrusionLayer(0, mGroundScale, Color.get(207, 209, 210));
mRoofs.next = mParts;
BuildingLayer.get(tile).setBuckets(mRoofs);
process(mTilePlane);
}
示例2: setPosition
import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public void setPosition(double latitude, double longitude, double accuracy) {
mLocation.x = MercatorProjection.longitudeToX(longitude);
mLocation.y = MercatorProjection.latitudeToY(latitude);
mRadius = accuracy / MercatorProjection.groundResolution(latitude, 1);
locationAccuracyRenderer.setLocation(mLocation.x, mLocation.y, mRadius);
}
示例3: onMapEvent
import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (e == Map.UPDATE_EVENT)
return;
double latitude = MercatorProjection.toLatitude(mapPosition.y);
if (!mRedrawNeeded) {
double scaleDiff = mPrevScale / mapPosition.scale;
if (scaleDiff < 1.1 && scaleDiff > 0.9) {
double latitudeDiff = Math.abs(mPrevLatitude - latitude);
if (latitudeDiff < LATITUDE_REDRAW_THRESHOLD)
return;
}
}
mPrevLatitude = latitude;
double groundResolution = MercatorProjection
.groundResolution(latitude, mapPosition.scale);
int[] scaleBarValues;
if (mImperialUnits) {
groundResolution = groundResolution / METER_FOOT_RATIO;
scaleBarValues = SCALE_BAR_VALUES_IMPERIAL;
} else {
scaleBarValues = SCALE_BAR_VALUES_METRIC;
}
float scaleBarLength = 0;
int mapScaleValue = 0;
for (int i = 0; i < scaleBarValues.length; ++i) {
mapScaleValue = scaleBarValues[i];
scaleBarLength = mapScaleValue / (float) groundResolution;
if (scaleBarLength < (BITMAP_WIDTH - 10)) {
break;
}
}
synchronized (mLayerBitmap) {
redrawMapScaleBitmap(scaleBarLength, mapScaleValue);
}
mBitmapLayer.updateBitmap();
mRedrawNeeded = false;
}
示例4: render
import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
/** TileLoaderThemeHook */
@Override
public boolean render(MapTile tile, RenderBuckets buckets, MapElement element,
RenderStyle style, int level) {
if (!(style instanceof ExtrusionStyle))
return false;
ExtrusionStyle extrusion = (ExtrusionStyle) style;
int height = 0;
int minHeight = 0;
String v = element.tags.getValue(Tag.KEY_HEIGHT);
if (v != null)
height = Integer.parseInt(v);
v = element.tags.getValue(Tag.KEY_MIN_HEIGHT);
if (v != null)
minHeight = Integer.parseInt(v);
/* 12m default */
if (height == 0)
height = 12 * 100;
ExtrusionBuckets ebs = get(tile);
for (ExtrusionBucket b = ebs.buckets; b != null; b = b.next()) {
if (b.colors == extrusion.colors) {
b.add(element, height, minHeight);
return true;
}
}
double lat = MercatorProjection.toLatitude(tile.y);
float groundScale = (float) MercatorProjection
.groundResolution(lat, 1 << tile.zoomLevel);
ebs.buckets = Inlist.push(ebs.buckets,
new ExtrusionBucket(0, groundScale,
extrusion.colors));
ebs.buckets.add(element, height, minHeight);
return true;
}
示例5: setPosition
import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public void setPosition(double latitude, double longitude, double accuracy) {
mLocation.x = MercatorProjection.longitudeToX(longitude);
mLocation.y = MercatorProjection.latitudeToY(latitude);
mRadius = accuracy / MercatorProjection.groundResolution(latitude, 1);
((LocationIndicator) mRenderer).animate(true);
}