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


Java SupportMapFragment类代码示例

本文整理汇总了Java中com.google.android.gms.maps.SupportMapFragment的典型用法代码示例。如果您正苦于以下问题:Java SupportMapFragment类的具体用法?Java SupportMapFragment怎么用?Java SupportMapFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SupportMapFragment类属于com.google.android.gms.maps包,在下文中一共展示了SupportMapFragment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);

    Intent i = getIntent();
    latitude  = i.getDoubleExtra(LAT_KEY,-8.047);
    longitude = i.getDoubleExtra(LON_KEY,-34.876);

    SupportMapFragment mapa = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapa);
    mapa.getMapAsync(this);

}
 
开发者ID:if710,项目名称:2017.2-codigo,代码行数:14,代码来源:MapActivity.java

示例2: getItem

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
public Fragment getItem(int position) {
    Log.v(TAG, "getItem, position = " + position);
    // getItem is called to instantiate the fragment for the given page.
    // Return a PlaceholderFragment (defined as a static inner class below).
    switch (position) {
        case 0:
            return FeedListFragment.newInstance();
        case 1:
            return RepositoriesListFragment.newInstance();
        case 2:
            return FollowingListFragment.newInstance();
        case 3:
            return FollowersListFragment.newInstance();
        case 4:
            return StarsListFragment.newInstance();
        case 5:
            LocationsReadyCallback callback = new LocationsReadyCallback(GeneralActivity.this);
            SupportMapFragment fragment = SupportMapFragment.newInstance();
            fragment.getMapAsync(callback);
            return fragment;
    }
    return PlaceholderFragment.newInstance(position + 1);
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:25,代码来源:GeneralActivity.java

示例3: onCreateView

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_detail_reminder_location_based, container, false);

    mContainer = (LinearLayout) rootView.findViewById(R.id.fragment_reminder_location_based_container);
    mAddress = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_address);
    mAddress.setText(mReminder.getPlace().getAddress());
    mRadius = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_radius);
    mRadius.setText(String.format(Locale.getDefault(),
            getResources().getString(R.string.fragment_detail_location_based_reminder_radius),
            mReminder.getPlace().getRadius(),
            mReminder.getEnteringExitingString(getActivity())) );


    // Get the SupportMapFragment and request notification
    // when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.fragment_reminder_location_based_map);
    mapFragment.getMapAsync(this);
    return rootView;
}
 
开发者ID:abicelis,项目名称:Remindy,代码行数:22,代码来源:LocationBasedReminderDetailFragment.java

示例4: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(MapsActivity.this);

    mPolyOpt.color(Color.LTGRAY);

    distance_value = (TextView) findViewById(R.id.distance_value);
    point_value = (TextView) findViewById(R.id.point_value);
    time_value = (TextView) findViewById(R.id.time_value);

}
 
开发者ID:carlosfaria94,项目名称:UbiBike-client,代码行数:17,代码来源:MapsActivity.java

示例5: onCreateView

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View mRootView = inflater.inflate(R.layout.fragment_map,container,false);
    hotels = new ArrayList<>();


    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map_item);
    mapFragment.getMapAsync(this);

     recyclerView = (RecyclerView) mRootView.findViewById(R.id.map_recycler_view);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    linearLayoutManager.setOrientation(LinearLayout.HORIZONTAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    mAdapter = new CardViewAdapter(hotels);
    mAdapter.setActionListner(this);
    recyclerView.setAdapter(mAdapter);

    if (mPresenter != null)
        mPresenter.loadHotels();


    return mRootView;
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:27,代码来源:MapFragment.java

示例6: newMapFragment

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
private static SupportMapFragment newMapFragment() {
    return SupportMapFragment.newInstance(new GoogleMapOptions()
            .camera(new CameraPosition.Builder()
                    .target(LocationAdapter.ZERO)
                    .zoom(DEFAULT_ZOOM)
                    .build()));
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:8,代码来源:CivifyMap.java

示例7: testGetMapFragment

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Test
public void testGetMapFragment() throws MapNotLoadedException {
    assertThat(mMap.isMapFragmentSet(), is(false));

    SupportMapFragment mapFragment = mMap.getMapFragment();
    assertThat(mapFragment, is(not(nullValue())));
    assertThat(mMap.isMapFragmentSet(), is(true));
    verify(mMap, atLeastOnce()).setMapFragment(mapFragment);

    when(mMap.isMapReady()).thenReturn(false);
    SupportMapFragment mapFragment2 = mMap.getMapFragment();
    assertThat(mapFragment2, is(not(sameInstance(mapFragment))));

    when(mMap.isMapReady()).thenReturn(true);
    assertThat(mMap.getMapFragment(), is(sameInstance(mapFragment2)));

    CivifyMarkers markers = mMap.getMarkers();
    mMap.outdateToBeRefreshed();
    assertThat(mMap.getMapFragment(), is(not(sameInstance(mapFragment2))));
    assertThat(mMap.getMarkers(), is(sameInstance(markers)));
    verify(mMap, never()).refreshIssues();
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:23,代码来源:CivifyMapTest.java

示例8: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps_profile);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    new NavDrawerSetup(this, toolbar).setupNav();

    SupportMapFragment mapFragment =
            (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.profile_map);
    mapFragment.getMapAsync(this);

    Intent intent = getIntent();
    // Get the list of the filtered moods from ProfileActivity
    profileFilteredMoods = (ArrayList<Mood>) intent.getSerializableExtra("profileFilteredList");
}
 
开发者ID:CMPUT301W17T08,项目名称:Moodr,代码行数:19,代码来源:MapsProfileActivity.java

示例9: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
/**
 * Flag indicating whether a requested permission has been denied after returning in
 * {@link #onRequestPermissionsResult(int, String[], int[])}.
 */


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    new NavDrawerSetup(this, toolbar).setupNav();

    SupportMapFragment mapFragment =
            (SupportMapFragment) getSupportFragmentManager().findFragmentById(map);
    mapFragment.getMapAsync(this);
}
 
开发者ID:CMPUT301W17T08,项目名称:Moodr,代码行数:21,代码来源:MapsActivity.java

示例10: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    try {

        gpsTracker = new com.trackin.iodroid.trackin.GPSTracker(getApplicationContext());
        mLocation = gpsTracker.getLocation();

        latitude = mLocation.getLatitude();
        longitude = mLocation.getLongitude();
      /*  Geocoder geocoder = new Geocoder(this);
        geocoder.get*/
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment
                mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        System.out.println("60");
        lat = gpsTracker.getLocation().getLatitude();
        lng = gpsTracker.getLocation().getLongitude();

    } catch (Exception e) {
        Toast.makeText(GPSActivity.this,"GPS not enabled!",Toast.LENGTH_LONG);
    }
}
 
开发者ID:jamesgeorge007,项目名称:TrackIn-Android-Application,代码行数:27,代码来源:GPSActivity.java

示例11: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    ActivityCompat.requestPermissions(MapsActivity.this, new String[] {android.Manifest.permission.ACCESS_FINE_LOCATION}, 123);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    GpsTracker gt = new GpsTracker(getApplicationContext());
    Location l = gt.getLocation();
    if( l == null){
        Toast.makeText(getApplicationContext(),"GPS unable to get Value",Toast.LENGTH_SHORT).show();
    }else {
        double lat = l.getLatitude();
        double lon = l.getLongitude();
        Toast.makeText(getApplicationContext(),"GPS Lat = "+lat+"\n lon = "+lon,Toast.LENGTH_SHORT).show();
    }
}
 
开发者ID:paramsingh,项目名称:marauders,代码行数:19,代码来源:MapsActivity.java

示例12: initView

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
private void initView() {
  locationPin = findViewById(R.id.location_pin);
  currentLocationBtn = findViewById(R.id.my_location_btn);
  checkPointsListBtn = findViewById(R.id.check_points_list_btn);
  View bottomSheet = findViewById(R.id.bottom_sheet);
  mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
  mBottomSheetBehavior.setHideable(true);
  mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);

  RecyclerView checkPointsList = findViewById(R.id.check_point_list_view);
  checkPointsList.setLayoutManager(new LinearLayoutManager(context));
  checkPointsList.setAdapter(checkPointsAdapter);
  autocompleteFragment = (PlaceAutocompleteFragment)
      getFragmentManager().findFragmentById(R.id.search_places_fragment);
  SupportMapFragment supportMapFragment =
      (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
  supportMapFragment.getMapAsync(this);
  bindEvents();
}
 
开发者ID:Arjun-sna,项目名称:LocationAware,代码行数:20,代码来源:LocationAlarmActivity.java

示例13: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    location = getIntent().getStringExtra("location");

    stringToLatLngMap = new HashMap<>();
    stringToLatLngMap.put("Main Auditorium", MAIN_AUDITORIUM);
    stringToLatLngMap.put("Main Stage", MAIN_STAGE);
    stringToLatLngMap.put("Mini Auditorium", MINI_AUDITORIUM);
    stringToLatLngMap.put("ECE Seminar Hall", ECE_SEMINAR_HALL);
    stringToLatLngMap.put("Central Seminar Hall", CENTRAL_SEMINAR_HALL);
    stringToLatLngMap.put("CSE Seminar Hall", CSE_SEMINAR_HALL);
    stringToLatLngMap.put("IT Seminar Hall", IT_SEMINAR_HALL);
    stringToLatLngMap.put("IT Classrooms", IT_CLASSROOMS);
    stringToLatLngMap.put("CSE Classrooms", CSE_CLASSROOMS);
    stringToLatLngMap.put("IT Labs", IT_LABS);
    stringToLatLngMap.put("Fountain", FOUNTAIN);
    stringToLatLngMap.put("Mech Seminar Hall", MECH_SEMINAR_HALL);
    stringToLatLngMap.put("Food Stalls", FOOD_STALL);

    mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    attemptEnableMyLocation();
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:26,代码来源:MapsActivity.java

示例14: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.maps_lokasi);
    mapFragment.getMapAsync(this);

    latitude = "-6.235510";
    longitude = "106.747263";

    toolbar = (Toolbar) findViewById(R.id.tool_bar); // Attaching the layout to the toolbar object
    toolbar.setLogoDescription(getResources().getString(R.string.sign_up_title));
    toolbar.setTitleTextColor(getResources().getColor(R.color.title));
    toolbar.setTitle("Rawan");
}
 
开发者ID:PandhuWibowo,项目名称:HackJakRawan,代码行数:18,代码来源:MapsActivity.java

示例15: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FontAwesome.apply();
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    permissions = new Permissions(this);
    dialogView = new DialogView(this);
    locationButton = (Button) findViewById(R.id.location);
    locationButton.setOnClickListener(this);
    save = (TextView) findViewById(R.id.save);
    save.setOnClickListener(this);
}
 
开发者ID:marckregio,项目名称:maklib,代码行数:18,代码来源:MapsActivity.java


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