|
|
@@ -34,6 +34,8 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
|
|
|
private MapFragment mGoogleMapView;
|
|
|
private GoogleMap mGoogleMap;
|
|
|
+ private com.google.android.gms.maps.MapView mMap;
|
|
|
+
|
|
|
private MapView mBaiduMap;
|
|
|
private Context mContext;
|
|
|
private Boolean mUseGoogleMap;
|
|
|
@@ -53,8 +55,6 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
init(context);
|
|
|
}
|
|
|
|
|
|
- View v;
|
|
|
-
|
|
|
|
|
|
@CallSuper
|
|
|
protected void onDetachedFromWindow() {
|
|
|
@@ -90,7 +90,7 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
mUseGoogleMap = true;
|
|
|
System.out.println("已经安装");
|
|
|
}
|
|
|
- mUseGoogleMap = false;
|
|
|
+// mUseGoogleMap = false;
|
|
|
|
|
|
// GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext.getApplicationContext());
|
|
|
|
|
|
@@ -100,9 +100,12 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
|
|
|
View relativeLayout = LayoutInflater.from(mContext).inflate(R.layout.ship_google_map,null);
|
|
|
// mGoogleMapView = relativeLayout.findViewById(R.id.ship_google_map);
|
|
|
- mGoogleMapView = ((MapFragment)((Activity)mContext).getFragmentManager().findFragmentById(R.id.ship_google_map));
|
|
|
- mGoogleMapView.getMapAsync(this);
|
|
|
+// mGoogleMapView = ((MapFragment)((Activity)mContext).getFragmentManager().findFragmentById(R.id.ship_google_map));
|
|
|
+// mGoogleMapView.getMapAsync(this);
|
|
|
|
|
|
+ mMap = relativeLayout.findViewById(R.id.ship_google_map);
|
|
|
+ mMap.onCreate(null);
|
|
|
+ mMap.getMapAsync(this);
|
|
|
|
|
|
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
|
|
|
addView(relativeLayout,layoutParams);
|