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


Java Map.getMapPosition方法代码示例

本文整理汇总了Java中org.oscim.map.Map.getMapPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Map.getMapPosition方法的具体用法?Java Map.getMapPosition怎么用?Java Map.getMapPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscim.map.Map的用法示例。


在下文中一共展示了Map.getMapPosition方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareDialog

import org.oscim.map.Map; //导入方法依赖的package包/类
public void prepareDialog(Map map, final Dialog dialog) {
	EditText editText = (EditText) dialog.findViewById(R.id.latitude);

	MapPosition mapCenter = map.getMapPosition();

	editText.setText(Double.toString(mapCenter.getLatitude()));

	editText = (EditText) dialog.findViewById(R.id.longitude);
	editText.setText(Double.toString(mapCenter.getLongitude()));

	SeekBar zoomlevel = (SeekBar) dialog.findViewById(R.id.zoomLevel);
	zoomlevel.setMax(Viewport.MAX_ZOOMLEVEL);
	zoomlevel.setProgress(10);

	final TextView textView = (TextView) dialog.findViewById(R.id.zoomlevelValue);
	textView.setText(String.valueOf(zoomlevel.getProgress()));
	zoomlevel.setOnSeekBarChangeListener(new SeekBarChangeListener(textView));
}
 
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:19,代码来源:LocationDialog.java

示例2: zoomIn

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper zoomIn() throws RemoteException {
    Log.d(TAG, "zoomIn");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {

        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(
                    GmsMapsTypeHelper.toZoom(mapPosition.getScale()) + 1));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:15,代码来源:CameraUpdateFactoryImpl.java

示例3: zoomOut

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper zoomOut() throws RemoteException {
    Log.d(TAG, "zoomOut");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(
                    GmsMapsTypeHelper.toZoom(mapPosition.getScale()) - 1));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:14,代码来源:CameraUpdateFactoryImpl.java

示例4: scrollBy

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper scrollBy(final float x, final float y) throws RemoteException {
    Log.d(TAG, "scrollBy");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setPosition(map.viewport()
                    .fromScreenPoint((float) (map.getWidth() / 2.0 + x),
                            (float) (map.getHeight() / 2.0 + y)));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:15,代码来源:CameraUpdateFactoryImpl.java

示例5: zoomTo

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper zoomTo(final float zoom) throws RemoteException {
    Log.d(TAG, "zoomTo");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(zoom));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:13,代码来源:CameraUpdateFactoryImpl.java

示例6: zoomBy

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper zoomBy(final float zoomDelta) throws RemoteException {
    Log.d(TAG, "zoomBy");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(
                    GmsMapsTypeHelper.toZoom(mapPosition.getScale()) + zoomDelta));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:14,代码来源:CameraUpdateFactoryImpl.java

示例7: zoomByWithFocus

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper zoomByWithFocus(final float zoomDelta, int x, int y)
        throws RemoteException {
    Log.d(TAG, "zoomByWithFocus");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(
                    GmsMapsTypeHelper.toZoom(mapPosition.getScale()) + zoomDelta));
            Log.w(TAG, "zoomBy with focus not yet supported"); // TODO
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:16,代码来源:CameraUpdateFactoryImpl.java

示例8: newLatLng

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper newLatLng(final LatLng latLng) throws RemoteException {
    Log.d(TAG, "newLatLng");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setPosition(GmsMapsTypeHelper.fromLatLng(latLng));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:13,代码来源:CameraUpdateFactoryImpl.java

示例9: newLatLngZoom

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper newLatLngZoom(final LatLng latLng, final float zoom)
        throws RemoteException {
    Log.d(TAG, "newLatLngZoom");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setPosition(GmsMapsTypeHelper.fromLatLng(latLng));
            mapPosition.setScale(GmsMapsTypeHelper.fromZoom(zoom));
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:15,代码来源:CameraUpdateFactoryImpl.java

示例10: newLatLngBounds

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper newLatLngBounds(final LatLngBounds bounds, int padding) throws RemoteException {
    Log.d(TAG, "newLatLngBounds");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setByBoundingBox(GmsMapsTypeHelper.fromLatLngBounds(bounds),
                    map.getWidth(), map.getHeight());
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:14,代码来源:CameraUpdateFactoryImpl.java

示例11: newLatLngBoundsWithSize

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public IObjectWrapper newLatLngBoundsWithSize(final LatLngBounds bounds, final int width, final int height, int padding)
        throws RemoteException {
    Log.d(TAG, "newLatLngBoundsWithSize");
    return new ObjectWrapper<CameraUpdate>(new MapPositionCameraUpdate() {
        @Override
        MapPosition getMapPosition(Map map) {
            MapPosition mapPosition = map.getMapPosition();
            mapPosition.setByBoundingBox(GmsMapsTypeHelper.fromLatLngBounds(bounds),
                    width, height);
            return mapPosition;
        }
    });
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:15,代码来源:CameraUpdateFactoryImpl.java

示例12: syncMapWithOtherMap

import org.oscim.map.Map; //导入方法依赖的package包/类
@Override
public void syncMapWithOtherMap(final MapPosition mapPosition,
								final ViewPart viewPart,
								final int positionFlags) {

	if (!_isMapSynched_WithOtherMap) {

		// sync feature is disabled

		return;
	}

	if (viewPart == this || !_isPartVisible) {

		// event is fired from this map -> ignore

		return;
	}

	final long timeDiff = System.currentTimeMillis() - _lastFiredSyncEventTime;

	if (timeDiff < 1000) {
		// ignore because it causes LOTS of problems when synching moved map
		return;
	}

	final Map map = _mapApp.getMap();

	/*
	 * Keep current tilt/bearing
	 */
	final MapPosition currentMapPos = map.getMapPosition();
	if (mapPosition.bearing == 0) {
		mapPosition.bearing = currentMapPos.bearing;
	}

	if (mapPosition.tilt == 0) {
		mapPosition.tilt = currentMapPos.tilt;
	}

	Map25ConfigManager.setMapLocation(map, mapPosition);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:43,代码来源:Map25View.java


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