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


Java GoogleMapOptions.compassEnabled方法代码示例

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


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

示例1: createMap

import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
private SupportMapFragment createMap()
{
	GoogleMapOptions options = new GoogleMapOptions();

	options.useViewLifecycleInFragment( true );
	options.compassEnabled( false );
	options.zoomControlsEnabled( false );

	final boolean mapControlEnabled = true;
	options.zoomGesturesEnabled( mapControlEnabled );
	options.scrollGesturesEnabled( mapControlEnabled );
	options.rotateGesturesEnabled( mapControlEnabled );
	options.tiltGesturesEnabled( mapControlEnabled );

	options.mapType( GoogleMap.MAP_TYPE_SATELLITE );

	CameraPosition camPos = new CameraPosition( DEFAULT_LOCATION, 0.0f, 30f, 0.0f );
	options.camera( camPos );

	SupportMapFragment mapFragment = SupportMapFragment.newInstance( options );

	return mapFragment;
}
 
开发者ID:Wavesonics,项目名称:TMinus,代码行数:24,代码来源:LocationBrowserFragment.java

示例2: createMap

import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
private MapFragment createMap()
{
	GoogleMapOptions options = new GoogleMapOptions();

	options.useViewLifecycleInFragment( true );
	options.compassEnabled( false );
	options.zoomControlsEnabled( false );

	final boolean mapControlEnabled = geMapControlsEnabled();
	options.zoomGesturesEnabled( mapControlEnabled );
	options.scrollGesturesEnabled( mapControlEnabled );
	options.rotateGesturesEnabled( mapControlEnabled );
	options.tiltGesturesEnabled( mapControlEnabled );

	options.mapType( GoogleMap.MAP_TYPE_SATELLITE );

	CameraPosition camPos = new CameraPosition( getLocation(), 0.0f, 30f, 0.0f );
	options.camera( camPos );

	MapFragment mapFragment = MapFragment.newInstance( options );

	return mapFragment;
}
 
开发者ID:Wavesonics,项目名称:TMinus,代码行数:24,代码来源:LocationDetailFragment.java

示例3: newInstance

import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
public static SupportMapFragment newInstance(double lat, double lng) {
    GoogleMapOptions options = new GoogleMapOptions();
    options.compassEnabled(true);
    options.mapType(GoogleMap.MAP_TYPE_NORMAL);

    MapFragment mapFragment = new MapFragment();
    Bundle bundle = new Bundle();
    bundle.putParcelable("MapOptions", options);
    mapFragment.setArguments(bundle);
    mapFragment.getMapAsync(mapFragment);
    mapFragment.mLat = lat;
    mapFragment.mLng = lng;
    mapFragment.setRetainInstance(true);
    return mapFragment;
}
 
开发者ID:ForrestFalcon,项目名称:fAlarm,代码行数:16,代码来源:MapFragment.java

示例4: onMapReady

import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;
    if (map == null) return;
    map.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(22.3964, 114.1095), 10));
    GoogleMapOptions options = new GoogleMapOptions();
    options.mapToolbarEnabled(false);
    options.compassEnabled(true);
    options.rotateGesturesEnabled(true);
    options.scrollGesturesEnabled(false);
    options.tiltGesturesEnabled(true);
    options.zoomControlsEnabled(false);
    options.zoomGesturesEnabled(true);
    map.setBuildingsEnabled(false);
    map.setIndoorEnabled(false);
    map.setTrafficEnabled(false);
    map.setOnMarkerClickListener(this);
    if (ActivityCompat.checkSelfPermission(getContext(),
            Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
            ActivityCompat.checkSelfPermission(getContext(),
                    Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        map.setMyLocationEnabled(true);
    }
    if (busRouteStops != null && busRouteStops.size() > 0) {
        PolylineOptions line = new PolylineOptions().width(20).zIndex(1)
                .color(ContextCompat.getColor(getContext(), R.color.colorAccent));
        for (BusRouteStop stop: busRouteStops) {
            LatLng latLng = new LatLng(Double.parseDouble(stop.latitude), Double.parseDouble(stop.longitude));
            line.add(latLng);
            IconGenerator iconFactory = new IconGenerator(getContext());
            Bitmap bmp = iconFactory.makeIcon(stop.sequence + ": " + stop.name);
            map.addMarker(new MarkerOptions().position(latLng)
                    .icon(BitmapDescriptorFactory.fromBitmap(bmp))).setTag(stop);
        }
        line.startCap(new RoundCap());
        line.endCap(new RoundCap());
        map.addPolyline(line);
        if (busRouteStops.size() < goToStopPos) {
            goToStopPos = 0;
        }
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(
                new LatLng(Double.parseDouble(busRouteStops.get(goToStopPos).latitude),
                        Double.parseDouble(busRouteStops.get(goToStopPos).longitude)), 16));
    }
}
 
开发者ID:alvinhkh,项目名称:buseta,代码行数:54,代码来源:LwbStopListFragment.java


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