高徳地図Apiを呼び出す

1274 ワード

Xml  
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" >


Java
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (mapLayout == null) {
mapLayout = inflater.inflate(R.layout.map_fragment, null);
mapView = (MapView) mapLayout.findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
if (aMap == null) {
aMap = mapView.getMap();
aMap.setMapType(AMap.MAP_TYPE_SATELLITE);// ,aMap 。
}
}else {
if (mapLayout.getParent() != null) {
((ViewGroup) mapLayout.getParent()).removeView(mapLayout);
}
}
RealTimePositionVelocityCalculator currentPositionVelocityCalculator =
mPositionVelocityCalculator;
if (currentPositionVelocityCalculator != null) {
currentPositionVelocityCalculator.setMapFragment(this);
}

return mapLayout;
}