本文整理汇总了Java中org.osmdroid.DefaultResourceProxyImpl类的典型用法代码示例。如果您正苦于以下问题:Java DefaultResourceProxyImpl类的具体用法?Java DefaultResourceProxyImpl怎么用?Java DefaultResourceProxyImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultResourceProxyImpl类属于org.osmdroid包,在下文中一共展示了DefaultResourceProxyImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BusStopOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public BusStopOverlay(StopsMapFragment fragment, Context context) {
super(new ArrayList<BusStopOverlayItem>(), null,
new DefaultResourceProxyImpl(context));
setOnFocusChangeListener(this);
this.fragment = fragment;
this.context = context;
this.bus_icon = (BitmapDrawable) ContextCompat.getDrawable(context, R.drawable.bus_icon);
this.bus_icon_selected = (BitmapDrawable) ContextCompat.getDrawable(context, R.drawable.bus_icon_selected);
//Scale based on screen resolution
this.bus_icon = new BitmapDrawable(context.getResources(),
Bitmap.createScaledBitmap(bus_icon.getBitmap(), getPixelsFromDP(40),
getPixelsFromDP(48) , false));
this.bus_icon_selected = new BitmapDrawable(context.getResources(),
Bitmap.createScaledBitmap(bus_icon_selected.getBitmap(), getPixelsFromDP(40),
getPixelsFromDP(48) , false));
}
示例2: CycleMapView
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public CycleMapView(final Context context, final String name) {
super(context,
256,
new DefaultResourceProxyImpl(context),
TileSource.mapTileProvider(context));
prefs_ = context.getSharedPreferences("net.cyclestreets.mapview."+name, Context.MODE_PRIVATE);
setBuiltInZoomControls(false);
setMultiTouchControls(true);
overlayBottomIndex_ = getOverlays().size();
location_ = new LocationOverlay(context, this);
getOverlays().add(location_);
controllerOverlay_ = new ControllerOverlay(context, this);
getOverlays().add(controllerOverlay_);
}
示例3: MapsforgeMapView
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public MapsforgeMapView(@NonNull Context context,
@NonNull TileCache tileCache,
@NonNull String offlineMapFilePath) {
super(context, MapsConfig.TILE_SIZE, new DefaultResourceProxyImpl(context), new MapsforgeTileProvider(context, tileCache, offlineMapFilePath), null);
}
示例4: createOneMap
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
/**
* Create one IndoorMap and trigger the download tasks that it needs.
*
* @param icon the icon for the fingerprints in the overlays.
* @return the new IndoorMap
*/
private IndoorMap createOneMap(final Drawable icon) {
final ItemizedIconOverlay<FingerprintItem> levelOverlay =
new ItemizedIconOverlay<FingerprintItem>(new ArrayList<FingerprintItem>(),
icon,
this,
new DefaultResourceProxyImpl(activity));
final IndoorMap map = new IndoorMap(levelOverlay);
return map;
}
示例5: createFingerprintOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
/**
* Create the overlay that displays the fingerprints, or rather, NOT displays any fingerprints.
* Overwrite this method if you want your FingerprintManager to actually draw fingerprint-icons!
*
* @param activity the activity, used for the context that the DefaultResourceProxyImpl of the overlay needs.
* @param icon the Drawable that will be used for the icons - if any are drawn.
* @return the new, invisible ItemizedIconOverlay
*/
protected ItemizedIconOverlay<FingerprintItem> createFingerprintOverlay(final Activity activity,
final Drawable icon) {
return new ItemizedIconOverlay<FingerprintItem>(new ArrayList<FingerprintItem>(),
icon,
this,
new DefaultResourceProxyImpl(activity)) {
@Override
protected void onDrawItem(final ISafeCanvas canvas, final FingerprintItem item,
final Point curScreenCoords, final float aMapOrientation) {
// Don't draw... this is the base-package, and only the admin-app needs these icons.
}
};
}
示例6: createProductOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
private void createProductOverlay() {
final Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.poi);
final Drawable icon = new BitmapDrawable(getResources(), bm);
productOverlay = new ItemizedIconOverlay<ProductItem>(
new ArrayList<ProductItem>(),
icon,
this,
new DefaultResourceProxyImpl(this)) {
};
}
示例7: setupTrackToView
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
private void setupTrackToView() {
// simulate flight Track
if (flightLog.size() == 0)
simulateTrack();
// Info Table
gpsData = (ListView) findViewById(R.id.fm_table);
gpsListAdapterView = new GpsListAdapter(this);
gpsData.setAdapter(gpsListAdapterView);
for (int j = 0; j < flightLog.size(); j++)
gpsListAdapterView.add(flightLog.get(j));
gpsData.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long arg3) {
map.getController().setCenter(
new GeoPoint(flightLog.get(position).getLatitude(),
flightLog.get(position).getLongitude()));
}
public void onNothingSelected(AdapterView parentView) {
}
});
double speedMax = 0.;
double heightMin = 0., heightMax = 0.;
for (int k = 0; k < flightLog.size(); k++) {
double speed = flightLog.get(k).getSpeedValue(SPEED.ms);
if (speedMax < speed)
speedMax = speed;
double height = flightLog.get(k).getAltitude();
if (heightMin > height)
heightMin = height;
if (heightMax < height)
heightMax = height;
}
StringBuilder flightInfo = new StringBuilder();
flightInfo.append("max. Speed " + speedMax + " m/s\n");
flightInfo.append("min. Height " + heightMin + ", max. Height "
+ heightMax);
tv_info.setText(flightInfo.toString());
// Overlay Path
PathOverlay myPath = new PathOverlay(Color.RED, this);
for (int i = 0; i < flightLog.size(); i++) {
myPath.addPoint(new GeoPoint(flightLog.get(i).getLatitude(),
flightLog.get(i).getLongitude()));
}
map.getOverlays().add(myPath);
// Special Points
map.getController().setCenter(getCenterPoint());
resourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
poi = new ArrayList<>();
OverlayItem start = new OverlayItem("Start", "Position",
new GeoPoint(flightLog.get(0).getLatitude(), flightLog.get(0)
.getLongitude()));
Drawable blkMarker = getResources().getDrawable(
R.drawable.map_blk_marker_small);
start.setMarker(blkMarker);
poi.add(start);
OverlayItem end = new OverlayItem("End", "Position", new GeoPoint(
flightLog.get(flightLog.size() - 1).getLatitude(), flightLog
.get(flightLog.size() - 1).getLongitude()));
Drawable blueMarker = getResources().getDrawable(
R.drawable.map_blue_marker_small);
end.setMarker(blueMarker);
poi.add(end);
POIItemizedOverlay overlay = new POIItemizedOverlay(this, poi);
map.getOverlays().add(overlay);
}
示例8: ItemizedOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public ItemizedOverlay(final Context context,
final MapView mapView,
final List<Item> items,
final OnItemTapListener<Item> listener)
{
super(new DefaultResourceProxyImpl(context));
mapView_ = mapView;
items_ = items;
itemListener_ = listener;
}
示例9: WikiArticlesOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public WikiArticlesOverlay(
final Drawable pDefaultMarker,
final Context pContext,
final long _trackId
)
{
super(pDefaultMarker, new DefaultResourceProxyImpl(pContext));
this.trackId = _trackId;
this.pContentResolver = pContext.getContentResolver();
waypoints = new ArrayList<GeoPoint>();
listItems = new ArrayList<ExtendedOverlayItem>();
}
示例10: WayPointsOverlay
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public WayPointsOverlay(
final Drawable pDefaultMarker,
final Context pContext,
final long trackId
)
{
super(pDefaultMarker, new DefaultResourceProxyImpl(pContext));
this.trackId = trackId;
this.pContentResolver = pContext.getContentResolver();
refresh();
}
示例11: onCreate
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的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());
}
示例12: onCreate
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layer);
this.resourceProxy = new DefaultResourceProxyImpl(
getApplicationContext());
this.prefs = getSharedPreferences(MainActivity.SETTINGS_FILE,
Context.MODE_PRIVATE);
final LayersAdapter adapter = new LayersAdapter(this,
this.createLayerList());
ListView list = (ListView) findViewById(R.id.items);
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view,
int position, long index) {
LayerEncapsulator entry = (LayerEncapsulator) adapter
.getItem(position);
SharedPreferences.Editor edit = prefs.edit();
edit.putBoolean(entry.getPreference(),
!prefs.getBoolean(entry.getPreference(), false));
edit.commit();
finish();
}
});
}
示例13: initMap
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
public MapView initMap() {
ActivityManager activityManager = (ActivityManager) getActivity().getSystemService(Context.ACTIVITY_SERVICE);
// Map Controler
this.mResourceProxy = new DefaultResourceProxyImpl(getActivity().getApplicationContext());
ITileSource tileSource = getPreferenceMapViewTile();
this.mapView = MapViewFactory.createOsmMapView(getActivity().getApplicationContext(), mResourceProxy, tileSource, activityManager);
this.mapController = mapView.getController();
// Multi touch capabilities
if(!getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)) {
mapView.setBuiltInZoomControls(true);
}
return this.mapView;
}
示例14: addIcons
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
private void addIcons() {
mItems = new ArrayList<OverlayItem>();
OverlayItem olItem = new OverlayItem("Here", "SampleDescription", mCurrentPoint);
Drawable newMarker = this.getResources().getDrawable(R.drawable.ic_launcher);
olItem.setMarker(newMarker);
mItems.add(olItem);
mResourceProxy = new DefaultResourceProxyImpl(this);
//mMyLocationOverlay = new ItemizedIconOverlay<OverlayItem>(mItems, newMarker, new Glistener(), mResourceProxy);
mMyItimizedLocationOverlay = new ItemizedIconOverlay<OverlayItem>(mItems, newMarker, null, mResourceProxy );
mMapView.getOverlays().clear();
mMapView.getOverlays().add(mMyItimizedLocationOverlay);
}
示例15: getDefaultResourceProxyImpl
import org.osmdroid.DefaultResourceProxyImpl; //导入依赖的package包/类
private DefaultResourceProxyImpl getDefaultResourceProxyImpl() {
return mDefaultResourceProxy == null
? mDefaultResourceProxy = new DefaultResourceProxyImpl(getActivity())
: mDefaultResourceProxy;
}