本文整理汇总了Java中org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay.setDrawAccuracyEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java MyLocationNewOverlay.setDrawAccuracyEnabled方法的具体用法?Java MyLocationNewOverlay.setDrawAccuracyEnabled怎么用?Java MyLocationNewOverlay.setDrawAccuracyEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay
的用法示例。
在下文中一共展示了MyLocationNewOverlay.setDrawAccuracyEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpMapIfNeeded
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; //导入方法依赖的package包/类
/**
* Description: Initialises the Map and sets initial options such as:
* Zoom levels and controls
* Compass
* ScaleBar
* Cluster Pin colors
* Location update settings
*/
private void setUpMapIfNeeded() {
// Check if we were successful in obtaining the map.
mMap.setBuiltInZoomControls(true);
mMap.setMultiTouchControls(true);
mMap.setMinZoomLevel(3);
mMap.setMaxZoomLevel(19); // Latest OSM can go to 21!
mMap.getTileProvider().createTileCache();
mCompassOverlay = new CompassOverlay(this, new InternalCompassOrientationProvider(this), mMap);
ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(this);
mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10);
mScaleBarOverlay.setCentred(true);
// Sets cluster pin color
mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(MapViewerOsmDroid.this);
//BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange);
BitmapDrawable mapPinDrawable = (BitmapDrawable) ResourcesCompat.getDrawable(getResources(),R.drawable.ic_map_pin_orange, null);
mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap());
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(MapViewerOsmDroid.this.getBaseContext());
gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates
gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates
mMyLocationOverlay = new MyLocationNewOverlay(MapViewerOsmDroid.this.getBaseContext(), gpsMyLocationProvider, mMap);
mMyLocationOverlay.setDrawAccuracyEnabled(true);
mMap.getOverlays().add(mCellTowerGridMarkerClusterer);
mMap.getOverlays().add(mMyLocationOverlay);
mMap.getOverlays().add(mCompassOverlay);
mMap.getOverlays().add(mScaleBarOverlay);
}
示例2: setUpMapIfNeeded
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; //导入方法依赖的package包/类
/**
* Description: Initialises the Map and sets initial options such as:
* Zoom levels and controls
* Compass
* ScaleBar
* Cluster Pin colors
* Location update settings
*/
private void setUpMapIfNeeded() {
// Check if we were successful in obtaining the map.
mMap.setBuiltInZoomControls(true);
mMap.setMultiTouchControls(true);
mMap.setMinZoomLevel(3);
mMap.setMaxZoomLevel(19); // Latest OSM can go to 21!
mMap.getTileProvider().createTileCache();
mCompassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), mMap);
ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(getActivity());
mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10);
mScaleBarOverlay.setCentred(true);
// Sets cluster pin color
mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(getActivity());
BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange);
mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap());
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(getActivity().getBaseContext());
gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates
gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates
mMyLocationOverlay = new MyLocationNewOverlay(getActivity().getBaseContext(), gpsMyLocationProvider, mMap);
mMyLocationOverlay.setDrawAccuracyEnabled(true);
mMap.getOverlays().add(mCellTowerGridMarkerClusterer);
mMap.getOverlays().add(mMyLocationOverlay);
mMap.getOverlays().add(mCompassOverlay);
mMap.getOverlays().add(mScaleBarOverlay);
}
示例3: setUpMapIfNeeded
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; //导入方法依赖的package包/类
/**
* Description: Initialises the Map and sets initial options such as:
* Zoom levels and controls
* Compass
* ScaleBar
* Cluster Pin colors
* Location update settings
*/
private void setUpMapIfNeeded() {
// Check if we were successful in obtaining the map.
mMap.setBuiltInZoomControls(true);
mMap.setMultiTouchControls(true);
mMap.setMinZoomLevel(3);
mMap.setMaxZoomLevel(19); // Latest OSM can go to 21!
mMap.getTileProvider().createTileCache();
mCompassOverlay = new CompassOverlay(this, new InternalCompassOrientationProvider(this), mMap);
ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(this);
mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10);
mScaleBarOverlay.setCentred(true);
// Sets cluster pin color
mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(MapViewerOsmDroid.this);
BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange);
mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap());
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(MapViewerOsmDroid.this.getBaseContext());
gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates
gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates
mMyLocationOverlay = new MyLocationNewOverlay(MapViewerOsmDroid.this.getBaseContext(), gpsMyLocationProvider, mMap);
mMyLocationOverlay.setDrawAccuracyEnabled(true);
mMap.getOverlays().add(mCellTowerGridMarkerClusterer);
mMap.getOverlays().add(mMyLocationOverlay);
mMap.getOverlays().add(mCompassOverlay);
mMap.getOverlays().add(mScaleBarOverlay);
}
示例4: onCreate
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize location requests
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
bestProvider = getLocationManager().getBestProvider(criteria, true);
// Create map
setContentView(R.layout.activity_map);
backButtonCount = 0;
mMap = (MapView) this.findViewById(R.id.map);
mMap.setTileSource(getTileSource());
mMap.setBuiltInZoomControls(true);
mMap.setMultiTouchControls(true);
mMap.getController().setZoom(3);
initLocation();
// Add your own location
mMyLocationOverlay = new MyLocationNewOverlay(getApplicationContext(), mMap);
mMyLocationOverlay.enableMyLocation();
mMyLocationOverlay.setDrawAccuracyEnabled(true);
mMap.getOverlays().add(mMyLocationOverlay);
resourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
}
示例5: setUpMapIfNeeded
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; //导入方法依赖的package包/类
/**
* Description: Initialises the Map and sets initial options such as:
* Zoom levels and controls
* Compass
* ScaleBar
* Cluster Pin colors
* Location update settings
*/
private void setUpMapIfNeeded() {
// Check if we were successful in obtaining the map.
mMap.setBuiltInZoomControls(true);
mMap.setMultiTouchControls(true);
mMap.setMinZoomLevel(3);
mMap.setMaxZoomLevel(19); // Latest OSM can go to 21!
mMap.getTileProvider().createTileCache();
mCompassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), mMap);
ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(getActivity());
mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10);
mScaleBarOverlay.setCentred(true);
// Sets cluster pin color
mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(getActivity());
//BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange);
BitmapDrawable mapPinDrawable = (BitmapDrawable) ResourcesCompat.getDrawable(getResources(), R.drawable.ic_map_pin_orange, null);
mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap());
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(getActivity().getBaseContext());
gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates
gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates
mMyLocationOverlay = new MyLocationNewOverlay(getActivity().getBaseContext(), gpsMyLocationProvider, mMap);
mMyLocationOverlay.setDrawAccuracyEnabled(true);
mMap.getOverlays().add(mCellTowerGridMarkerClusterer);
mMap.getOverlays().add(mMyLocationOverlay);
mMap.getOverlays().add(mCompassOverlay);
mMap.getOverlays().add(mScaleBarOverlay);
}