|
|
@@ -27,6 +27,7 @@ import com.baidu.mapapi.map.MapView;
|
|
|
import com.baidu.mapapi.map.Marker;
|
|
|
import com.baidu.mapapi.map.MarkerOptions;
|
|
|
import com.baidu.mapapi.model.LatLng;
|
|
|
+import com.google.android.gms.maps.CameraUpdate;
|
|
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
|
|
import com.google.android.gms.maps.GoogleMap;
|
|
|
import com.google.android.gms.maps.MapFragment;
|
|
|
@@ -124,6 +125,10 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
mBaiduMap = new MapView(mContext);
|
|
|
mBaiduMap.getMap().setOnMarkerClickListener(this);
|
|
|
|
|
|
+ // 设置当前缩放
|
|
|
+ MapStatusUpdate u = MapStatusUpdateFactory.zoomTo(mBaiduMap.getMap().getMinZoomLevel());
|
|
|
+ mBaiduMap.getMap().setMapStatus(u);
|
|
|
+
|
|
|
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
|
|
|
addView(mBaiduMap,layoutParams);
|
|
|
}
|
|
|
@@ -158,6 +163,7 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
if (pol != null) {
|
|
|
handleLocation(pol,AnnotationDisplayPriorityHigh);
|
|
|
}
|
|
|
+// moveToLocation(pol);
|
|
|
}
|
|
|
if (showPoe()) {
|
|
|
JSONObject poe = annotation.optJSONObject("poe");
|
|
|
@@ -378,6 +384,11 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
if (mAnnotation != null) {
|
|
|
showShipAnnotation(mAnnotation);
|
|
|
}
|
|
|
+ mGoogleMap.getUiSettings().setMapToolbarEnabled(false); // 隐藏底部ToolBar 导航按钮
|
|
|
+
|
|
|
+ // 设置缩放级别
|
|
|
+ CameraUpdate zoom = CameraUpdateFactory.zoomTo(mGoogleMap.getMinZoomLevel());
|
|
|
+ mGoogleMap.animateCamera(zoom);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -388,10 +399,19 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
@Override
|
|
|
public boolean onMarkerClick(Marker marker) {
|
|
|
|
|
|
- View viewCache = LayoutInflater.from(mContext).inflate(R.layout.ship_map_bubble, null);
|
|
|
+// View viewCache = LayoutInflater.from(mContext).inflate(R.layout.ship_map_bubble, null);
|
|
|
+//
|
|
|
+// TextView tv_title = (TextView) viewCache.findViewById(R.id.bubble_title);
|
|
|
+// TextView tv_info = (TextView) viewCache.findViewById(R.id.bubble_detail);
|
|
|
+
|
|
|
+ View viewCache = ((Activity)mContext)
|
|
|
+ .getLayoutInflater().inflate(
|
|
|
+ R.layout.marker_view, null);
|
|
|
|
|
|
- TextView tv_title = (TextView) viewCache.findViewById(R.id.bubble_title);
|
|
|
- TextView tv_info = (TextView) viewCache.findViewById(R.id.bubble_detail);
|
|
|
+ TextView tv_title = (TextView) viewCache
|
|
|
+ .findViewById(R.id.tv_title);
|
|
|
+ TextView tv_info = (TextView) viewCache
|
|
|
+ .findViewById(R.id.tv_info);
|
|
|
|
|
|
tv_title.setText(marker.getTitle());
|
|
|
tv_info.setText(marker.getExtraInfo().getString("detail"));
|