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


Java MapView.setTilesScaledToDpi方法代码示例

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


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

示例1: mapSetup

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
private void mapSetup() {
    map = (MapView) getActivity().findViewById(R.id.createPoiMap);

    //important! set your user agent to prevent getting banned from the osm servers
    Configuration.getInstance().load(getActivity(), PreferenceManager.getDefaultSharedPreferences(getActivity()));

    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);

    // add multi-touch capability
    map.setMultiTouchControls(true);

    // add compass to map
    CompassOverlay compassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), map);
    compassOverlay.enableCompass();
    map.getOverlays().add(compassOverlay);

    // get map controller
    IMapController controller = map.getController();

    GeoPoint position = new GeoPoint(latitude, longitude);
    controller.setCenter(position);
    controller.setZoom(18);
    MapUtils.addMarker(getActivity(), map, latitude, longitude);
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:26,代码来源:CreatePoiFragment.java

示例2: mapSetup

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
private void mapSetup() {
    map = (MapView) getActivity().findViewById(R.id.map);  // create basic map
    mController = map.getController(); // get map controller
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);
    map.setMultiTouchControls(true);

    // add compass to map
    CompassOverlay compassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), map);
    compassOverlay.enableCompass();
    map.getOverlays().add(compassOverlay);

    //attach listeners
    MapEventsOverlay mapEventsOverlay = new MapEventsOverlay(this);
    map.getOverlays().add(0, mapEventsOverlay);
    setupMyLocation();
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:18,代码来源:MapFragment.java

示例3: setupMapPreview

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
private void setupMapPreview(double lat, double lon, String markerTitle) {
    //important! set your user agent to prevent getting banned from the osm servers
    Configuration.getInstance().load(getDialog().getContext(), PreferenceManager.getDefaultSharedPreferences(getDialog().getContext()));

    map = (MapView) getDialog().findViewById(R.id.poiDialogMap);
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);
    map.setMultiTouchControls(true);

    // add compass to map
    CompassOverlay compassOverlay = new CompassOverlay(getDialog().getContext(), new InternalCompassOrientationProvider(getDialog().getContext()), map);
    compassOverlay.enableCompass();
    map.getOverlays().add(compassOverlay);

    // get map controller
    IMapController controller = map.getController();
    GeoPoint position = new GeoPoint(lat, lon);
    controller.setCenter(position);
    controller.setZoom(18);

    MapUtils.addMarker(getActivity(), map, lat, lon, markerTitle);
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:23,代码来源:PoiDetailsFragment.java

示例4: mapSetup

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
private void mapSetup() {
    map = (MapView) getActivity().findViewById(R.id.createPoiMap);
    //important! set your user agent to prevent getting banned from the osm servers
    Configuration.getInstance().load(getActivity(), PreferenceManager.getDefaultSharedPreferences(getActivity()));
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);
    map.setMultiTouchControls(true);

    CompassOverlay compassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), map);
    compassOverlay.enableCompass();
    map.getOverlays().add(compassOverlay);

    IMapController controller = map.getController();
    GeoPoint position = new GeoPoint(POI.getLatitude(), POI.getLongitude());
    controller.setCenter(position);
    controller.setZoom(18);

    MapUtils.addMarker(getActivity(), map, POI.getLatitude(), POI.getLongitude());
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:20,代码来源:EditPoiFragment.java

示例5: chooseBeautifulMapProvider

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
public static void chooseBeautifulMapProvider(Context context, MapView map)
{
    MapBoxTileSource tileSource = new MapBoxTileSource(context);
    map.setTilesScaledToDpi(true);
    tileSource.setMapboxMapid("mapbox.emerald");
    map.setTileSource(tileSource);
}
 
开发者ID:LenaShervarly,项目名称:TreasureHunting,代码行数:8,代码来源:MapHelper.java

示例6: initContentView

import org.osmdroid.views.MapView; //导入方法依赖的package包/类
@Override
    protected void initContentView() {
        mResourceProxy = new OsmResourceImpl(this);

        mapview = new MapView(this,mResourceProxy);
        OnlineTileSourceBase GoogleMap = GoogleTileSource.getDefultGoogleTileSource();
        mapview.setTileSource(GoogleMap);
        FrameLayout.LayoutParams mapParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        maplayout.addView(mapview, mapParams);
        mapview.setTilesScaledToDpi(true);
        mapview.setMinZoomLevel(3);
        mapview.setMultiTouchControls(true);
        mapview.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if (!isTouchable){
                    return false;
                }
                if (ontouch(event)){
                    isClick = false;
                    v.postDelayed(cleanMarker,500);
                }
                return false;
            }
        });

        ivPath.setOnClickListener(this);
        poiMapPathBtn.setOnClickListener(this);
        poiMapLocationBar.setOnClickListener(this);
        llContent.setOnClickListener(this);
//        locationClient = new AMapLocationClient(getApplicationContext());
        locationUtil = JoyApplication.getLocationUtil();
        locationUtil.gettAccuracyLocation(this,2000);
//        MapUtil.initAccuracyLocation(locationClient, this);
    }
 
开发者ID:joy-inc,项目名称:joy-app,代码行数:37,代码来源:MapActivity.java


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