本文整理汇总了Java中org.oscim.map.Map.POSITION_EVENT属性的典型用法代码示例。如果您正苦于以下问题:Java Map.POSITION_EVENT属性的具体用法?Java Map.POSITION_EVENT怎么用?Java Map.POSITION_EVENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.oscim.map.Map
的用法示例。
在下文中一共展示了Map.POSITION_EVENT属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMapEvent
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (e == Map.ANIM_START) {
// throw new RuntimeException("Use MapView animator instance of map.animator");
mAnimator.cancel();
} else if (e == Map.POSITION_EVENT) {
{// set yOffset at dependency of tilt
if (mapPosition.getTilt() > 0) {
float offset = MathUtils.linearInterpolation
(viewport().getMinTilt(), viewport().getMaxTilt(), 0, 0.8f, mapPosition.getTilt());
viewport().setMapScreenCenter(offset);
} else {
viewport().setMapScreenCenter(0);
}
}
}
// mostly handled at MapView
}
示例2: onMapEvent
@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
if (event == Map.CLEAR_EVENT) {
/* sync with TileRenderer */
synchronized (mRenderer) {
tileRenderer().clearTiles();
mTileManager.init();
}
if (mTileManager.update(mapPosition))
notifyLoaders();
} else if (event == Map.POSITION_EVENT) {
if (mTileManager.update(mapPosition))
notifyLoaders();
}
}
示例3: onMapEvent
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
//Log.w("LI", "C: " + (e == Map.CLEAR_EVENT) + " P: " + (e == Map.POSITION_EVENT) + " M: " + (e == Map.MOVE_EVENT) + " R: " + (e == Map.REDRAW_EVENT) + " U: " + (e == Map.UPDATE_EVENT));
if (e == Map.POSITION_EVENT) {
updateLocation(mapPosition.getLatitude(), mapPosition.getLongitude(), mapPosition.getZoomLevel());
}
}
示例4: onMapEvent
@Override
public void onMapEvent(final Event event, final MapPosition mapPosition) {
if (event == Map.CLEAR_EVENT) {
_worker.cancel(true);
}
if (!isEnabled()) {
return;
}
if (event == Map.POSITION_EVENT) {
_worker.submit(MAX_RELABEL_DELAY);
}
}
示例5: onMapEvent
@Override
public void onMapEvent(Event event, MapPosition pos) {
super.onMapEvent(event, pos);
if (event != Map.POSITION_EVENT)
return;
FadeStep[] fade = mTileSource.getFadeSteps();
if (fade == null) {
//mRenderLayer.setBitmapAlpha(1);
return;
}
float alpha = 0;
for (FadeStep f : fade) {
if (pos.scale < f.scaleStart || pos.scale > f.scaleEnd)
continue;
if (f.alphaStart == f.alphaEnd) {
alpha = f.alphaStart;
break;
}
double range = f.scaleEnd / f.scaleStart;
float a = (float) ((range - (pos.scale / f.scaleStart)) / range);
a = FastMath.clamp(a, 0, 1);
// interpolate alpha between start and end
alpha = a * f.alphaStart + (1 - a) * f.alphaEnd;
break;
}
tileRenderer().setBitmapAlpha(alpha);
}
示例6: onMapEvent
@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
if (event == Map.CLEAR_EVENT)
mWorker.cancel(true);
if (event == Map.POSITION_EVENT)
mWorker.submit(MAX_RELABEL_DELAY);
}
示例7: onMapEvent
@Override
public void onMapEvent(Event e, MapPosition pos) {
if (mUpdate) {
mUpdate = false;
mWorker.submit(0);
} else if (e == Map.POSITION_EVENT || e == Map.CLEAR_EVENT) {
// throttle worker
mWorker.submit(mUpdateDelay);
}
}
示例8: onMapEvent
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (e == Map.POSITION_EVENT) {
mTrackingOffsetFactor = Math.cos(Math.toRadians(mapPosition.tilt) * 0.85);
if (mCompassView.getVisibility() == View.GONE && mapPosition.bearing != 0f && mLocationState != LocationState.TRACK) {
if (Math.abs(mapPosition.bearing) < 1.5f) {
mapPosition.setBearing(0f);
mMap.setMapPosition(mapPosition);
}
}
adjustCompass(mapPosition.bearing);
if (mAutoTiltSet) {
if (mAutoTilt != mapPosition.tilt) {
mAutoTiltSet = false;
mAutoTiltShouldSet = false;
}
} else {
if (mAutoTiltShouldSet)
mAutoTiltSet = mapPosition.tilt == mAutoTilt;
}
}
if (e == Map.MOVE_EVENT) {
if (mLocationState == LocationState.NORTH || mLocationState == LocationState.TRACK) {
mPreviousLocationState = mLocationState;
mLocationState = LocationState.ENABLED;
updateLocationDrawable();
}
if (mFirstMove) {
mFirstMove = false;
mPopupAnchor.setX(mMap.getWidth() - 32 * MapTrek.density);
mPopupAnchor.setY(mStatusBarHeight + 8 * MapTrek.density);
HelperUtils.showTargetedAdvice(MainActivity.this, Configuration.ADVICE_LOCK_MAP_POSITION, R.string.advice_lock_map_position, mPopupAnchor, R.drawable.ic_volume_down);
}
}
if (mMapDownloadButton.getVisibility() != View.GONE) {
if (mapPosition.zoomLevel < 8) {
mMapDownloadButton.setVisibility(View.GONE);
mMapDownloadButton.setTag(null);
} else if (e == Map.MOVE_EVENT) {
final Message m = Message.obtain(mMainHandler, new Runnable() {
@Override
public void run() {
mMapDownloadButton.setVisibility(View.GONE);
mMapDownloadButton.setTag(null);
}
});
m.what = R.id.msgRemoveMapDownloadButton;
mMainHandler.sendMessageDelayed(m, 1000);
}
}
}
示例9: onMapEvent
@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
if (isEnabled() && (event == Map.MOVE_EVENT || event == Map.POSITION_EVENT)) {
((CrosshairRenderer) mRenderer).show();
}
}