小编Joh*_*man的帖子

Android谷歌地图移动相机

我一直用Android实现谷歌地图.我正在使用框架布局来查看地图,它的工作原理.但是,我想使用移动相机将地图聚焦到特定位置.但是,我无法使用我的代码实现它.

MainActivity.java

public class MainActivity extends Activity {

private MainMapFragement mapFragment;
private HashMap<Marker, EventInfo> eventMarkerMap;
EventInfo firstEventInfo;
Marker firstMarker;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.map_activity);
    mapFragment = new MainMapFragement();
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.add(R.id.map, mapFragment);
    ft.commit();

}

@Override
protected void onStart() {
    super.onStart();
    setUpEventSpots();
}



private void setUpEventSpots() {
    // I'm going to make 2 EventInfo objects and place them on the map
    eventMarkerMap = new HashMap<Marker, EventInfo>();
    EventInfo firstEventInfo = new EventInfo(new LatLng(7.190708000000000000, 125.455340999999980000), "Right now - …
Run Code Online (Sandbox Code Playgroud)

android google-maps infowindow

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

google-maps ×1

infowindow ×1