I have updated play services from 9.0.1
to 15.0.0
, now i am seeing that MapView.getMap();
is no longer supported.
I checked this, I followed it and fixed the problem.
public class MapsFragment extends Fragment implements OnMapReadyCallback{
MapView mMapView;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mMapView = (MapView) view.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
}
Layout
<com.google.android.gms.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
The issue is, I am using MapView
and not GoogleMap
, so i have just added onMapReady()
method as its required by interface, but i am not doing anything in it.
Everything sees to be working fine, but should i change MapView
to GoogleMap
, or its fine, if i keep using MapView
in play-services:15.0.0