本文整理汇总了Java中org.oscim.event.Event类的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于org.oscim.event包,在下文中一共展示了Event类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:19,代码来源:CacheboxMapAdapter.java
示例2: onInputEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onInputEvent(Event e, MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action == MotionEvent.ACTION_DOWN) {
downX = motionEvent.getX() - mMap.getWidth() / 2;
downY = motionEvent.getY() - mMap.getHeight() / 2;
}
if (mActiveMarker == null)
return;
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
// Update corresponding waypoint
Waypoint waypoint = (Waypoint) mActiveMarker.getUid();
waypoint.setCoordinates(mActiveMarker.getPoint());
onWaypointSave(waypoint);
mActiveMarker = null;
// Unshift map to its original position
mMap.animator().animateTo(MAP_POSITION_ANIMATION_DURATION / 2, mMap.viewport().fromScreenPoint(mMap.getWidth() / 2, mMap.getHeight() / 2 - mFingerTipSize), 1, true);
mMap.getEventLayer().enableMove(true);
} else if (action == MotionEvent.ACTION_MOVE) {
float eventX = motionEvent.getX() - deltaX;
float eventY = motionEvent.getY() - deltaY - 3 * mFingerTipSize;
mActiveMarker.setPoint(mMap.viewport().fromScreenPoint(eventX, eventY));
mMarkerLayer.updateItems();
mMap.updateMap(true);
}
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:27,代码来源:MainActivity.java
示例3: onInputEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onInputEvent(Event event, MotionEvent motionEvent) {
if ((motionEvent.getAction() == MotionEvent.ACTION_CANCEL || motionEvent.getAction() == MotionEvent.ACTION_UP) && currentlyDraggedItem != null) {
currentlyDraggedItem.onDragStop();
currentlyDraggedItem = null;
}
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
dragLastX = motionEvent.getX();
dragLastY = motionEvent.getY();
}
if (motionEvent.getAction() == MotionEvent.ACTION_MOVE && currentlyDraggedItem != null) {
Point out = new Point();
mapView.map().viewport().toScreenPoint(GmsMapsTypeHelper.fromLatLng(currentlyDraggedItem.getPosition()), out);
out.x += mapView.getWidth() / 2;
out.y += mapView.getHeight() / 2;
float mx = motionEvent.getX() - dragLastX;
float my = motionEvent.getY() - dragLastY;
currentlyDraggedItem.setPosition(GmsMapsTypeHelper.toLatLng(mapView.map().viewport().fromScreenPoint((float) out.getX() + mx, (float) out.getY() + my)));
currentlyDraggedItem.onDragProgress();
dragLastX += mx;
dragLastY += my;
}
}
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:24,代码来源:BackendMap.java
示例4: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:19,代码来源:TileLayer.java
示例5: setMapMode
import org.oscim.event.Event; //导入依赖的package包/类
public void setMapMode(MapMode mapMode, boolean programmatic, Event event) {
MapMode lastMode = CB.mapMode;
CB.mapMode = mapMode;
log.debug("Set to Mode: {} from last Mode {} / fireEvet:{}", mapMode, lastMode, !programmatic);
if (!programmatic && this.stateChangedListener != null)
this.stateChangedListener.stateChanged(mapMode, lastMode, event);
Gdx.graphics.requestRendering();
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:9,代码来源:MapStateButton.java
示例6: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:8,代码来源:LocationInformation.java
示例7: create
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void create() {
super.create();
/**
* Overwrite input handler, using own GdxMap.create() method didn't work :-(
*/
final InputMultiplexer mux = new InputMultiplexer();
if (!Parameters.MAP_EVENT_LAYER2) {
mGestureDetector = new GestureDetector(new GestureHandlerImpl(mMap));
mux.addProcessor(mGestureDetector);
}
mux.addProcessor(new InputHandlerMT(this));
mux.addProcessor(new MotionHandler(mMap));
Gdx.input.setInputProcessor(mux);
mMap.events.bind(new UpdateListener() {
@Override
public void onMapEvent(final Event e, final MapPosition mapPosition) {
_map25View.fireSyncMapEvent(mapPosition, 0);
}
});
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:30,代码来源:Map25App.java
示例8: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:16,代码来源:LabelLayerMT.java
示例9: onTileManagerEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onTileManagerEvent(final Event e, final MapTile tile) {
if (e == TileManager.TILE_LOADED) {
if (tile.isVisible && isEnabled()) {
_worker.submit(MAX_RELABEL_DELAY / 4);
//log.debug("tile loaded: {}", tile);
}
} else if (e == TileManager.TILE_REMOVED) {
//log.debug("tile removed: {}", tile);
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:13,代码来源:LabelLayerMT.java
示例10: setupMap
import org.oscim.event.Event; //导入依赖的package包/类
private void setupMap() {
final OSciMap4TileSource tileSource = new OSciMap4TileSource(getTileBaseSource());
tileSource.setHttpEngine(new OkHttpEngine.OkHttpFactory(getTileCache()));
baseLayer = getMap().setBaseMap(tileSource);
getMap().layers().add(new BuildingLayer(getMap(), baseLayer));
highlightMarker = getHighlightMarkerSymbol();
getMap().layers().add(new LabelLayer(getMap(), baseLayer));
poiMarkersLayer = buildPoiMarkersLayer();
getMap().layers().add(poiMarkersLayer);
locationMarkerLayer = new ItemizedLayer<MarkerItem>(getMap(),
meMarkers, getDefaultMarkerSymbol(), null);
getMap().layers().add(locationMarkerLayer);
setTheme(MapzenStyle.Theme.MAPZEN);
getMap().events.bind(new Map.UpdateListener() {
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (e == Map.POSITION_EVENT) {
followMe = false;
}
mapController.storeMapPosition(mapPosition);
}
});
}
开发者ID:mapzen,项目名称:open,代码行数:32,代码来源:MapFragment.java
示例11: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onMapEvent(final Event e, MapPosition mapPosition) {
if (activeTask != null) {
activeTask.cancel(true);
}
activeTask = new DrawPathTask(app);
activeTask.execute(route.getGeometry());
}
开发者ID:mapzen,项目名称:open,代码行数:9,代码来源:RouteFragment.java
示例12: Map
import org.oscim.event.Event; //导入依赖的package包/类
public Map() {
mViewport = new ViewController();
mAnimator = new Animator(this);
mLayers = new Layers(this);
input = new EventDispatcher<InputListener, MotionEvent>() {
@Override
public void tell(InputListener l, Event e, MotionEvent d) {
l.onInputEvent(e, d);
}
};
events = new EventDispatcher<UpdateListener, MapPosition>() {
@Override
public void tell(UpdateListener l, Event e, MapPosition d) {
l.onMapEvent(e, d);
}
};
mAsyncExecutor = new AsyncExecutor(4, this);
mMapPosition = new MapPosition();
mEventLayer = new MapEventLayer(this);
mLayers.add(0, mEventLayer);
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:28,代码来源:Map.java
示例13: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:34,代码来源:BitmapTileLayer.java
示例14: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:10,代码来源:LabelLayer.java
示例15: onTileManagerEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onTileManagerEvent(Event e, MapTile tile) {
if (e == TileManager.TILE_LOADED) {
if (tile.isVisible)
mWorker.submit(MAX_RELABEL_DELAY / 4);
//log.debug("tile loaded: {}", tile);
} else if (e == TileManager.TILE_REMOVED) {
//log.debug("tile removed: {}", tile);
}
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:11,代码来源:LabelLayer.java
示例16: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@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,代码行数:11,代码来源:AbstractVectorLayer.java
示例17: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
synchronized (mRenderer) {
someConccurentVariable++;
}
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:8,代码来源:CustomRenderLayer.java
示例18: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
/* ignore map events */
if (event != Map.CLEAR_EVENT)
return;
//super.onMapEvent(event, mapPosition);
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:9,代码来源:TileRenderTest.java
示例19: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (!mControlOrientation) {
float rotation = -mapPosition.bearing;
adjustArrow(rotation, rotation);
}
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:8,代码来源:Compass.java
示例20: onMapEvent
import org.oscim.event.Event; //导入依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (mBubble.isOpen()) {
GeoPoint gp = mItemWithBubble.getPoint();
Point p = mTmpPoint;
mMap.viewport().toScreenPoint(gp, p);
mBubble.position((int) p.x, (int) p.y);
}
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:12,代码来源:ItemizedOverlayWithBubble.java
注:本文中的org.oscim.event.Event类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论