Java 类com.google.android.gms.maps.MapView 实例源码

项目:GoalsAndHabits    文件:MyHabitsMapActivity.java   
/**
 * Called on activity start. Generates layout and button functionality.
 * @param savedInstanceState
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my_habits_map);

    events = (ArrayList<HabitEvent>) getIntent().getSerializableExtra("event list");
    if (events==null || events.size()<1){finish();}


    Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
    toolbar.setTitle("Map of My Habit History");
    toolbar.setNavigationIcon(R.drawable.ic_close_button);
    setSupportActionBar(toolbar);

    map = (MapView) findViewById(R.id.myHabitsMap);
    map.onCreate(savedInstanceState);
    map.getMapAsync(this);
}
项目:Protestr    文件:MainActivity.java   
@Override
public void preLoadGoogleMaps() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            try {
                MapView mv = new MapView(getApplicationContext());
                mv.onCreate(null);
                mv.onPause();
                mv.onDestroy();
            } catch (Exception ignored) {
                // ignored
            }
        }
    }).start();
}
项目:Runnest    文件:ChallengeSenderFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view =  inflater.inflate(R.layout.fragment_challenge_sender, container, false);

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);

    googleApiClient = ((ChallengeActivity)getActivity()).getGoogleApiClient();
    locationSettingsHandler = ((ChallengeActivity)getActivity()).getLocationSettingsHandler();

    distance = (TextView) view.findViewById(R.id.sender_distance);

    String userName = ((AppRunnest)getActivity().getApplication()).getUser().getName();
    run = new Run(userName);

    return view;
}
项目:Runnest    文件:RunningMapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view =  inflater.inflate(R.layout.fragment_running_map, container, false);

    // Buttons
    GUISetup(view);

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this); //this is important

    // Location
    setupLocation();

    return view;
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * Implementation of the react create view instance method - returns the map view to react.
 *
 * @param context
 * @return MapView
 */
@Override
protected MapView createViewInstance(ThemedReactContext context) {
    mapView = new MapView(context);

    mapView.onCreate(null);
    mapView.onResume();

    if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
    }

    reactContext = context;

    return mapView;
}
项目:bugshaker-android    文件:MapScreenshotProvider.java   
@NonNull
@Override
public Observable<Bitmap> getScreenshotBitmap(@NonNull final Activity activity) {
    final Observable<Bitmap> nonMapViewsBitmapObservable = getNonMapViewsBitmap(activity);

    final View rootView = ActivityUtils.getRootView(activity);
    final List<MapView> mapViews = locateMapViewsInHierarchy(rootView);

    if (mapViews.isEmpty()) {
        return nonMapViewsBitmapObservable;
    } else {
        final Observable<List<LocatedBitmap>> mapViewBitmapsObservable
                = getMapViewBitmapsObservable(mapViews);

        return Observable
                .zip(nonMapViewsBitmapObservable, mapViewBitmapsObservable, BITMAP_COMBINING_FUNCTION);
    }
}
项目:bugshaker-android    文件:MapScreenshotProvider.java   
@NonNull
@VisibleForTesting
protected List<MapView> locateMapViewsInHierarchy(@NonNull final View view) {
    final List<MapView> result = new ArrayList<>();

    final Queue<View> viewsToProcess = new LinkedList<>();
    viewsToProcess.add(view);

    while (!viewsToProcess.isEmpty()) {
        final View viewToProcess = viewsToProcess.remove();

        if (viewToProcess instanceof MapView && viewToProcess.getVisibility() == VISIBLE) {
            result.add((MapView) viewToProcess);
        } else if (viewToProcess instanceof ViewGroup) {
            final ViewGroup viewGroup = (ViewGroup) viewToProcess;

            for (int childIndex = 0; childIndex < viewGroup.getChildCount(); childIndex++) {
                viewsToProcess.add(viewGroup.getChildAt(childIndex));
            }
        }
    }

    return result;
}
项目:cpe-manifest-android-experience    文件:ECSceneLocationMapFragment.java   
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mapView = (MapView) view.findViewById(R.id.ec_mapview);
    if(mapView != null) {
        mapView.onCreate(savedInstanceState);
    }

    if (defaultSceneLocations != null) {
        List<String> list = new ArrayList<String>();
        for (LocationItem scLoc : defaultSceneLocations) {
            list.add(scLoc.getTitle());
        }
        setupPins();
    }

    mapButton = (Button) view.findViewById(R.id.map_button);
    satelliteButton = (Button) view.findViewById(R.id.satellite_button);
    if (satelliteButton != null && mapButton != null) {
        mapButton.setOnClickListener(this);
        satelliteButton.setOnClickListener(this);
        onClick(mapButton);
    }

}
项目:gps-measurement-tools    文件:MapFragment.java   
@Override
public View onCreateView(
    LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(R.layout.map_fragment, container, false);
  mMapView = ((MapView) rootView.findViewById(R.id.map));
  mMapView.onCreate(savedInstanceState);
  mMapView.getMapAsync(this);
  MapsInitializer.initialize(getActivity());

  RealTimePositionVelocityCalculator currentPositionVelocityCalculator =
      mPositionVelocityCalculator;
  if (currentPositionVelocityCalculator != null) {
    currentPositionVelocityCalculator.setMapFragment(this);
  }

  return rootView;
}
项目:Japp16    文件:JappMapFragment.java   
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    movementManager.onSaveInstanceState(savedInstanceState);
    pinningManager.onSaveInstanceState(savedInstanceState);
    savedInstanceState.putBoolean(BUNDLE_OSM_ACTIVE, osmActive);
    if (!osmActive) {
        Bundle mapBundle = new Bundle();
        googleMapView.onSaveInstanceState(mapBundle);

        savedInstanceState.putBundle(BUNDLE_MAP, mapBundle);
    }else if (jotiMap instanceof OsmJotiMap){
        org.osmdroid.views.MapView osmMap = ((OsmJotiMap) jotiMap).getOSMMap();
        Bundle osmMapBundle = new Bundle();
        osmMapBundle.putInt(OSM_ZOOM, osmMap.getZoomLevel());
        osmMapBundle.putDouble(OSM_LAT, osmMap.getMapCenter().getLatitude());
        osmMapBundle.putDouble(OSM_LNG, osmMap.getMapCenter().getLongitude());
        osmMapBundle.putFloat(OSM_OR, osmMap.getMapOrientation());
        savedInstanceState.putBundle(OSM_BUNDLE, osmMapBundle);
    }
    // Always call the superclass so it can save the view hierarchy state
    super.onSaveInstanceState(savedInstanceState);
}
项目:CellularNetworkMonitor    文件:MapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.location_fragment, container, false);

    mMapView = (MapView) rootView.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);

    mMapView.onResume(); // needed to get the map to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mMapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap mMap) {
            googleMap = mMap;
            refreshMap(null);
        }
    });

    return rootView;
}
项目:snazzymaps-browser    文件:GridAdapter.java   
/**
 * Manages creating or re-using the ViewHolder for each grid item.
 */
public View getView(int position, View convertView, ViewGroup parent) {

    ViewHolder holder;

    if (convertView == null) {
        convertView = ((LayoutInflater) mContext.getSystemService(
                Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.grid_item, null);
        holder = new ViewHolder();
        holder.mapView = (MapView) convertView.findViewById(R.id.grid_item);
        convertView.setTag(holder);
        holder.initializeMapView();
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    SnazzyMapsStyle style = (SnazzyMapsStyle) getItem(position);
    holder.mapView.setTag(style);
    if (holder.map != null) {
        initializeMap(holder.map, style);
    }

    return convertView;
}
项目:dealhunting    文件:DetailLocationFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
  View root = inflater.inflate(R.layout.fragment_detail_location, container, false);

  mMapView = (MapView) root.findViewById(R.id.mapView);

  mMapView.onCreate(savedInstanceState);
  mMapView.onResume();

  recycleView = (RecyclerView) root.findViewById(R.id.location_recycler_view);

  locationAdapter = new LocationAdapter(getActivity());
  recycleView.setAdapter(locationAdapter);
  recycleView.setLayoutManager(new LinearLayoutManager(getActivity()));

  return root;
}
项目:calchoochoo    文件:MapSearchFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_map_search, container, false);
  ButterKnife.bind(this, view);

  unWrapBundle(savedInstanceState);

  // http://stackoverflow.com/questions/13900322/badparcelableexception-in-google-maps-code
  if (savedInstanceState != null) {
    savedInstanceState.remove(BundleKeys.STOPS);
  }

  // initialize the map!
  googleMapView = ((MapView) view.findViewById(R.id.search_google_maps));
  googleMapView.onCreate(savedInstanceState);
  googleMapView.getMapAsync(this);

  return view;
}
项目:lp2go    文件:ViewControllerMap.java   
@Override
public void init() {
    super.init();

    mMapView = (MapView) findViewById(R.id.map);
    mMapHelper = new MapHelper(getMainActivity());

    if (mMapView != null) {
        mMapView.onCreate(null);
        mMapView.getMapAsync(mMapHelper);
    }

    txtLatitude = (TextView) findViewById(R.id.txtLatitude);
    txtLongitude = (TextView) findViewById(R.id.txtLongitude);
    txtMapGPS = (TextView) findViewById(R.id.txtMapGPS);
    txtMapGPSSatsInView = (TextView) findViewById(R.id.txtMapGPSSatsInView);
}
项目:gaso    文件:MapGasoFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_map, container, false);

    mapView = (MapView) v.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);

    mapView.onResume();// needed to get the googleMap to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mapView.getMapAsync(this);

    progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
    emptyListTextView = (TextView) v.findViewById(R.id.emptyListText);

    mapUpdateHandler = new Handler();

    mapUpdater.run();

    return v;
}
项目:HuddlOut_client    文件:MapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    FrameLayout v = (FrameLayout) inflater.inflate(R.layout.fragment_map, container, false);

    mapView = (MapView) v.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    mapView.onResume();
    mapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap googleMap) {
            Log.i("DevMsg", "Success!!!!!");
            myMap = googleMap;
            populateMap();
        }
    });


    return v;
}
项目:igcparser    文件:FlightPreviewActivity.java   
private void findViews() {
    setContentView(R.layout.activity_flight_preview);
    mapView = (MapView) findViewById(R.id.main_map);
    txtDistance = (TextView) findViewById(R.id.main_txt_distance);
    txtMaxAltitude = (TextView) findViewById(R.id.main_txt_max_altitude);
    txtMinAltitude = (TextView) findViewById(R.id.main_txt_start_altitude);
    txtTakeOffTime = (TextView) findViewById(R.id.main_txt_takeoff);
    txtLandingTime = (TextView) findViewById(R.id.main_txt_landing);
    txtFlightTime = (TextView) findViewById(R.id.main_txt_duration);
    txtGlider = (TextView) findViewById(R.id.main_txt_glider);
    txtPilot = (TextView) findViewById(R.id.main_txt_pilot);
    layoutGlider = (LinearLayout) findViewById(R.id.main_layout_glider);
    layoutPilot = (LinearLayout) findViewById(R.id.main_layout_pilot);
    txtMoreInfo = (TextView) findViewById(R.id.main_information_btn_viewmore);
    cardviewInformation = (CardView) findViewById(R.id.main_cardview_information);
    loading = (ProgressBar) findViewById(R.id.main_loading);
    btnCloseInformation = findViewById(R.id.main_cardview_close);
    btnShowInformation = findViewById(R.id.main_information_btn);
    btnPlay = (ImageView) findViewById(R.id.main_btn_play);
    btnSpeedUp = (ImageView) findViewById(R.id.main_btn_speed_up);
    btnSpeedDown = (ImageView) findViewById(R.id.main_btn_speed_down);
    viewAltitudeReferenceBar = findViewById(R.id.altitude_reference_bar);
    layoutAltitudeReference = (RelativeLayout) findViewById(R.id.altitude_reference_layout);

}
项目:Runch    文件:RestaurantInfoActivity.java   
@Override
protected void onResume() {
    super.onResume();

    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    if (resultCode == ConnectionResult.SUCCESS) {
        mRecyclerView.setAdapter(mListAdapter);
    } else {
        GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1).show();
    }

    if (mListAdapter != null) {
        for (MapView m : mListAdapter.getMapViews()) {
            m.onResume();
        }
    }
}
项目:Runch    文件:RestaurantInfoViewHolder.java   
public RestaurantInfoViewHolder(Context context, View view) {

        super(view);
        mContext = context;
        recommend_msg  = (TextView)view.findViewById(R.id.recommend_restaurant_comment);
        name = (TextView) view.findViewById(R.id.restaurant_name);
        meta = (TextView) view.findViewById(R.id.restaurant_meta);
        addr = (TextView) view.findViewById(R.id.address);
        phoneNum = (TextView)view.findViewById(R.id.phone_number);
        rating = (TextView)view.findViewById(R.id.rating);
        ratingBar = (RatingBar)view.findViewById(R.id.ratingBar);
        mapView = (MapView) view.findViewById(R.id.map);

        recommend_msg.setVisibility(View.GONE);
        meta.setVisibility(View.GONE);

        ratingBar.setStepSize((float)0.5);
        ratingBar.setIsIndicator(false);

        mapView.onCreate(null);
        mapView.getMapAsync(this);
    }
项目:margarita    文件:LocationFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.location_fragment, container, false);
    // Gets the MapView from the XML layout and creates it
    mapView = (MapView) view.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);

    // Gets to GoogleMap from the MapView and does initialization stuff
    map = mapView.getMap();
    map.getUiSettings().setMyLocationButtonEnabled(false);
    map.setMyLocationEnabled(true);

    // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
    MapsInitializer.initialize(this.getActivity());
    map.setOnMarkerDragListener(this);

    mNetworkConnection = new NetworkConnection(getActivity());
    mLocationProvider = new LocationProvider(getActivity(), this);

    return view;
}
项目:DotHike    文件:ResultsActivity.java   
protected void setupMap(){
    // GoogleMapOptions to Set Map to Lite Mode
    GoogleMapOptions googleMapOptions = new GoogleMapOptions().liteMode(true);

    mMapView = new MapView(this, googleMapOptions);

    mMapView.setClickable(false);

    mMapView.setLayoutParams(new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    mMapView.setMinimumHeight(MAP_HEIGHT);
    mMapContainer.addView(mMapView);
    mMapContainer.setMinimumHeight(MAP_HEIGHT);

    mMapView.onCreate(null);
    mMapView.onResume();
    mMapView.getMapAsync(this);
}
项目:mage-android    文件:GeoPackageTileTableCacheOverlay.java   
@Override
public String onMapClick(LatLng latLng, MapView mapView, GoogleMap map) {
    StringBuilder message = new StringBuilder();

    for(FeatureOverlayQuery featureOverlayQuery: featureOverlayQueries){
        String overlayMessage = featureOverlayQuery.buildMapClickMessage(latLng, mapView, map);
        if(overlayMessage != null){
            if(message.length() > 0){
                message.append("\n\n");
            }
            message.append(overlayMessage);
        }
    }

    return message.length() > 0 ? message.toString() : null;
}
项目:actor-platform    文件:MapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    longitude = getArguments().getDouble("longitude");
    latitude = getArguments().getDouble("latitude");


    final MapView map = new MapView(getActivity());

    map.onCreate(null);

    map.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap googleMap) {
            mapController = googleMap;
            googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(""));
            googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
                    new LatLng(latitude, longitude),
                    16));
            map.onResume();
        }
    });

    return map;

}
项目:CheDream    文件:ContactsFragment.java   
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    mMapView = (MapView) view.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);
    mMapView.onResume();

    boolean isGooglePlayServicesAvailable = ConnectionResult.SUCCESS ==
            GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity());

    if (isGooglePlayServicesAvailable) {
        setMap();
    } else {
        mMapView.setVisibility(View.GONE);
    }

    ListView listViewContacts = (ListView) view.findViewById(R.id.listview_contacts);
    listViewContacts.setAdapter(new ContactsAdapter(getActivity()));
}
项目:QuietPlaces    文件:QPMapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_map, container, false);
    if (rootView == null) {
        Log.e(TAG, "rootView is null in onCreateView in QPMapFragment");
        return null;
    }

    MapsInitializer.initialize(getMyActivity());

    mMapView = (MapView) rootView.findViewById(R.id.map);
    if (mMapView != null) {
        mMapView.onCreate(mBundle);
        setUpMapIfNeeded(rootView);
    }

    MainActivity mainActivity = (MainActivity) getActivity();

    CheckBox followingUserCB = (CheckBox) rootView.findViewById(R.id.follow_user_checkBox);
    followingUserCB.setChecked(mainActivity.isFollowingUser());

    return rootView;
}
项目:android-map_list    文件:MapListActivity.java   
@Override
protected void onResume() {
    super.onResume();

    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    if (resultCode == ConnectionResult.SUCCESS) {
        mRecyclerView.setAdapter(mListAdapter);
    } else {
        GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1).show();
    }

    if (mListAdapter != null) {
        for (MapView m : mListAdapter.getMapViews()) {
            m.onResume();
        }
    }
}
项目:WMB    文件:RouteMapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,
                         ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    Bundle args = getArguments();

    setUpBundleArgs(args);

    View v = inflater.inflate(R.layout.fragment_route_map, container, false);

    if (v != null) {
        mapView = (MapView) v.findViewById(R.id.map);
        if (mapView != null) {
            mapView.onCreate(savedInstanceState);
        }
    }

    MapsInitializer.initialize(this.getActivity());

    route = getRoute();

    setupMapIfNeeded(fromStop);

    return v;
}
项目:disconnected-content-explorer-android    文件:GeoPackageTableMapData.java   
/**
 * Query and build a map click location message from GeoPackage table
 *
 * @param latLng  click location
 * @param mapView map view
 * @param map     map
 * @return click message
 */
public String mapClickMessage(LatLng latLng, MapView mapView, GoogleMap map) {
    StringBuilder message = null;

    if (featureOverlayQueries != null) {
        for (FeatureOverlayQuery featureOverlayQuery : featureOverlayQueries) {
            String overlayMessage = featureOverlayQuery.buildMapClickMessage(latLng, mapView, map, projection);
            if (overlayMessage != null) {
                if (message == null) {
                    message = new StringBuilder();
                } else {
                    message.append("\n\n");
                }
                message.append(overlayMessage);
            }
        }
    }

    return message != null ? message.toString() : null;
}
项目:disconnected-content-explorer-android    文件:ReportMapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_report_map, container, false);

    mapView = (MapView) view.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
       mapView.getMapAsync(this);

       mapOverlaysView = view.findViewById(R.id.mapOverlays);
       ImageButton mapOverlaysButton = (ImageButton) mapOverlaysView
               .findViewById(R.id.mapOverlaysButton);
       mapOverlaysButton.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View arg0) {
               Intent intent = new Intent(getActivity(), OverlaysActivity.class);
               getActivity().startActivityForResult(intent, ReportCollectionActivity.OVERLAYS_ACTIVITY);
           }
       });

    return view;
}
项目:PalHunterClient    文件:HomeFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,
    @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  if (view != null) {
    ViewGroup parent = (ViewGroup) view.getParent();
    if (parent != null)
      parent.removeView(view);

  }
  view = inflater.inflate(R.layout.home_frg, container, false);
  mMapView = (MapView) view.findViewById(R.id.mapView);
  mMapView.onCreate(savedInstanceState);
  mMapView.onResume();

  try {
    MapsInitializer.initialize(context.getApplicationContext());
  } catch (Exception e) {
    e.printStackTrace();
  }
  initViews(view);
  return view;
}
项目:ceeq    文件:SecurityFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    setActionBar();
    View view = inflater.inflate(R.layout.fragment_security, container, false);

    autoBlip = (ToggleButton) view.findViewById(R.id.toggle_blip);
    autoLocate = (ToggleButton) view.findViewById(R.id.toggle_locate);
    wipe = (Button) view.findViewById(R.id.wipe);
    wipeCache = (Button) view.findViewById(R.id.wipe_cache);

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.onResume();
    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }
    map = mapView.getMap();
    setupMap();

    setupListeners();
    return view;
}
项目:jcertif-android-2013    文件:MapEventFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    getSherlockActivity().getSupportActionBar().setNavigationMode(
            com.actionbarsherlock.app.ActionBar.NAVIGATION_MODE_STANDARD);
    setRetainInstance(true);
    View rootView=inflater.inflate(R.layout.fragment_map, container,false);

    getActivity().setTitle(R.string.app_name);
    setHasOptionsMenu(true);

    mapv=(MapView)rootView.findViewById(R.id.mapview);
    mapv.onCreate(savedInstanceState);

    onMapReady();

    return rootView;
}
项目:TFG-SmartU-La-red-social    文件:FragmentMapa.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View inflatedView = inflater.inflate(R.layout.fragment_mapa, container, false);

    mMapView = (MapView) inflatedView.findViewById(R.id.mapa);
    mMapView.onCreate(mBundle);

    mMapView.getMapAsync(this);
    return inflatedView;
}
项目:TFG-SmartU-La-red-social    文件:FragmentMapaProyecto.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View inflatedView = inflater.inflate(R.layout.fragment_mapa_proyecto, container, false);

    mMapView = (MapView) inflatedView.findViewById(R.id.mapa_proyecto);
    mMapView.onCreate(mBundle);

    mMapView.getMapAsync(this);
    return inflatedView;
}
项目:ExtraMapUtils    文件:BasicFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_basic,
            container, false);
    areaTextView = (TextView) view.findViewById(R.id.area);
    lengthTextView = (TextView) view.findViewById(R.id.length);
    mMap = (MapView) view.findViewById(R.id.mapLite);
    mMap.onCreate(savedInstanceState);
    mMap.getMapAsync(this);
    return view;
}
项目:youth-health    文件:MapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_map, container, false);

    mMapView = (MapView) rootView.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);

    mMapView.onResume(); // needed to get the map to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mMapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap mMap) {
            googleMap = mMap;

            // For dropping a marker at a point on the Map
            LatLng sydney = new LatLng(-34, 151);
            googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker Title").snippet("Marker Description"));

            // For zooming automatically to the location of the marker
            CameraPosition cameraPosition = new CameraPosition.Builder().target(sydney).zoom(12).build();
            googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        }
    });

    return rootView;
}
项目:Remindy    文件:PlaceViewHolder.java   
public PlaceViewHolder(View itemView) {
    super(itemView);

    mContainer = (RelativeLayout) itemView.findViewById(R.id.item_place_container);
    mAlias = (TextView) itemView.findViewById(R.id.item_place_alias);
    mAddress = (TextView) itemView.findViewById(R.id.item_place_address);
    mMapView = (MapView) itemView.findViewById(R.id.item_place_map);
    mMapView.setClickable(false);

    // Initialise the MapView
    mMapView.onCreate(null);
    // Set the map ready callback to receive the GoogleMap object
    mMapView.getMapAsync(this);
}
项目:techstar-org    文件:MapFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_map, container, false);

    mMapView = (MapView) rootView.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);

    mMapView.onResume(); // needed to get the map to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mMapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap mMap) {
            googleMap = mMap;

            // For dropping a marker at a point on the Map
            LatLng sydney = new LatLng(-34, 151);
            googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker Title").snippet("Marker Description"));

            // For zooming automatically to the location of the marker
            CameraPosition cameraPosition = new CameraPosition.Builder().target(sydney).zoom(12).build();
            googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        }
    });

    return rootView;
}
项目:Runnest    文件:ChallengeReceiverFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view =  inflater.inflate(R.layout.fragment_challenge_receiver, container, false);

    warningText = (TextView) view.findViewById(R.id.warning_text);
    warningText.setVisibility(View.GONE);
    lastUpdateTime = SystemClock.elapsedRealtime();

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);

    run = new Run(((ChallengeActivity)getActivity()).getOpponentName());
    run.start();

    distance = (TextView) view.findViewById(R.id.receiver_distance);
    updateDisplayedDistance();

    handler = new Handler();
    runnableCode = new Runnable() {
        @Override
        public void run() {
            updateWarningTextVisibility();
            handler.postDelayed(runnableCode, TIME_BEFORE_NOTIFY_MISSING_UPDATES);
        }
    };
    handler.post(runnableCode);

    return view;
}