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


Java Map.POSITION_EVENT属性代码示例

本文整理汇总了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
    }
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:18,代码来源:CacheboxMapAdapter.java

示例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();
	}
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:18,代码来源:TileLayer.java

示例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());
    }
}
 
开发者ID:andreynovikov,项目名称:trekarta,代码行数:7,代码来源:LocationInformation.java

示例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);
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:15,代码来源:LabelLayerMT.java

示例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);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:33,代码来源:BitmapTileLayer.java

示例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);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:9,代码来源:LabelLayer.java

示例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);
	}
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:10,代码来源:AbstractVectorLayer.java

示例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);
        }
    }
}
 
开发者ID:andreynovikov,项目名称:trekarta,代码行数:51,代码来源:MainActivity.java

示例9: onMapEvent

@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
    if (isEnabled() && (event == Map.MOVE_EVENT || event == Map.POSITION_EVENT)) {
        ((CrosshairRenderer) mRenderer).show();
    }
}
 
开发者ID:andreynovikov,项目名称:trekarta,代码行数:6,代码来源:CrosshairLayer.java


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