本文整理汇总了Java中org.osmdroid.events.ScrollEvent类的典型用法代码示例。如果您正苦于以下问题:Java ScrollEvent类的具体用法?Java ScrollEvent怎么用?Java ScrollEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScrollEvent类属于org.osmdroid.events包,在下文中一共展示了ScrollEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scrollTo
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public void scrollTo(int x, int y) {
setMapScroll(x, y);
resetProjection();
invalidate();
// Force a layout, so that children are correctly positioned according to map orientation
if (getMapOrientation() != 0f)
myOnLayout(true, getLeft(), getTop(), getRight(), getBottom());
// do callback on listener
for (MapListener mapListener: mListners){
final ScrollEvent event = new ScrollEvent(this, x, y);
mapListener.onScroll(event);
}
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:17,代码来源:MapView.java
示例2: setCenter
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
/**
* Set the map view to the given center. There will be no animation.
*/
@Override
public void setCenter(final IGeoPoint point) {
// If no layout, delay this call
for (MapListener mapListener: mMapView.mListners) {
mapListener.onScroll(new ScrollEvent(mMapView, 0, 0));
}
if (!mMapView.isLayoutOccurred()) {
mReplayController.setCenter(point);
return;
}
mMapView.setExpectedCenter(point);
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:16,代码来源:MapController.java
示例3: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
/**
* handles the map movement rendering portions, prevents more than one render at a time,
* waits for the user to stop moving the map before triggering the render
*/
@Override
public boolean onScroll(ScrollEvent event) {
lastMovement = System.currentTimeMillis();
needsDataRefresh = true;
return false;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:11,代码来源:HeatMap.java
示例4: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public boolean onScroll(ScrollEvent event) {
if(lastEvent+40 < System.currentTimeMillis()) {
lastEvent=System.currentTimeMillis();
if (event.getSource() == mMapView) {
mMapView2.getController().setCenter(mMapView.getMapCenter());
} else {
mMapView.getController().setCenter(mMapView2.getMapCenter());
}
}
return true;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:16,代码来源:SampleSplitScreen.java
示例5: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
/***********************************************
* MapListener interface implementation
***********************************************/
public boolean onScroll(ScrollEvent scrollEvent) {
Log.d("MapListener", scrollEvent.toString());
boolean isOsmDataDownloadAutomatic = SettingsManager.getInstance().getBoolean(MapzenPreferenceActivity.PREF_DOWNLOAD_OSM, true);
if (isOsmDataDownloadAutomatic)
tryUpdateData();
return true;
}
开发者ID:Mapzen-POI-Collector,项目名称:Mapzen-Android,代码行数:11,代码来源:OsmPoisOverlay.java
示例6: onCreateView
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
Log.d(TAG, "onCreateView");
View createdView;
if (getMapLayoutId() == -1) {
LinearLayout linearLayout =
(LinearLayout) inflater.inflate(getLayoutId(), container, false);
linearLayout.addView(this.mapView);
createdView = linearLayout;
} else {
createdView = inflater.inflate(getLayoutId(), container, false);
LinearLayout mapLayout = (LinearLayout) createdView.findViewById(getMapLayoutId());
mapLayout.addView(this.mapView);
}
this.mapView.setMapListener(
new DelayedMapListener(
new MapListener() {
Integer x, y;
public boolean onZoom(final ZoomEvent zoomEvent) {
Log.i(TAG, "onZoom: " + zoomEvent.getZoomLevel());
currentStrategy.onMapDisplacement(
mapView.getZoomLevel(),
mapView.getMapCenter().getLatitude(),
mapView.getMapCenter().getLongitude());
return true;
}
public boolean onScroll(final ScrollEvent e) {
Log.d(TAG, "onScroll");
MapFragment.this.onScroll();
if (x == null || y == null) {
x = e.getX();
y = e.getY();
} else if (x == e.getX() && y == e.getY()) {
return true;
}
currentStrategy.onMapDisplacement(
mapView.getZoomLevel(),
mapView.getMapCenter().getLatitude(),
mapView.getMapCenter().getLongitude());
return true;
}
}, 200));
return createdView;
}
开发者ID:InspectorIncognito,项目名称:androidApp,代码行数:55,代码来源:MapFragment.java
示例7: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public boolean onScroll(final ScrollEvent event)
{
refreshItems();
return true;
}
开发者ID:MobileAppCodes,项目名称:CycleStreets-Android-app-,代码行数:7,代码来源:LiveItemOverlay.java
示例8: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public boolean onScroll(ScrollEvent event) {
return false;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:5,代码来源:SampleOsmPath.java
示例9: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public boolean onScroll(ScrollEvent scrollEvent) {
updateGridlines();
return false;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:6,代码来源:SampleGridlines.java
示例10: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
@Override
public boolean onScroll(ScrollEvent scrollEvent) {
return false;
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:5,代码来源:MinMaxZoomLevel.java
示例11: onScroll
import org.osmdroid.events.ScrollEvent; //导入依赖的package包/类
/******************************************
* MapListener interface implementation
******************************************/
@Override
public boolean onScroll(ScrollEvent event) {
return mPoisOverlay.onScroll(event);
}
开发者ID:Mapzen-POI-Collector,项目名称:Mapzen-Android,代码行数:8,代码来源:MapActivity.java
注:本文中的org.osmdroid.events.ScrollEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论