use of com.google.android.gms.maps.OnMapReadyCallback in project NPSmiles by bmcglynn1.
the class ItemOneFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_contact_page, container, false);
SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
OnMapReadyCallback obj = new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
LatLng smiles = new LatLng(39.104729, -77.191294);
mMap.addMarker(new MarkerOptions().position(smiles).title("North Potomac Smiles, LLC."));
mMap.moveCamera(CameraUpdateFactory.newLatLng(smiles));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(smiles, 16));
}
};
mapFragment.getMapAsync(obj);
return view;
}
use of com.google.android.gms.maps.OnMapReadyCallback in project actor-platform by actorapp.
the class MapFragment method onCreateView.
@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;
}
use of com.google.android.gms.maps.OnMapReadyCallback in project Signal-Android by WhisperSystems.
the class SignalMapView method display.
public ListenableFuture<Bitmap> display(final SignalPlace place) {
final SettableFuture<Bitmap> future = new SettableFuture<>();
this.mapView.onCreate(null);
this.mapView.onResume();
this.mapView.setVisibility(View.VISIBLE);
this.imageView.setVisibility(View.GONE);
this.mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(final GoogleMap googleMap) {
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLong(), 13));
googleMap.addMarker(new MarkerOptions().position(place.getLatLong()));
googleMap.setBuildingsEnabled(true);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.getUiSettings().setAllGesturesEnabled(false);
googleMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
googleMap.snapshot(new GoogleMap.SnapshotReadyCallback() {
@Override
public void onSnapshotReady(Bitmap bitmap) {
future.set(bitmap);
imageView.setImageBitmap(bitmap);
imageView.setVisibility(View.VISIBLE);
mapView.setVisibility(View.GONE);
mapView.onPause();
mapView.onDestroy();
}
});
}
});
}
});
this.textView.setText(place.getDescription());
return future;
}
Aggregations