コード例 #1
0
        /**
         * 初始化Map
         */
        private void InitMap()
        {
            // 北京市
            if (mMapController1 == null)
            {
                mMapController1 = Android.Runtime.Extensions.JavaCast<SupportMapFragment>(SupportFragmentManager
                        .FindFragmentById(Resource.Id.map1)).MapView.Controller;
                mMapController1.SetMapStatus(NewMapStatusWithGeoPointAndZoom(GEO_BEIJING, 10));
            }

            // 上海市
            if (mMapController2 == null)
            {
                mMapController2 = Android.Runtime.Extensions.JavaCast<SupportMapFragment>(SupportFragmentManager
                        .FindFragmentById(Resource.Id.map2)).MapView.Controller;
                mMapController2.SetMapStatus(NewMapStatusWithGeoPointAndZoom(GEO_SHANGHAI, 10));
            }

            // 广州市
            if (mMapController3 == null)
            {
                mMapController3 = Android.Runtime.Extensions.JavaCast<SupportMapFragment>(SupportFragmentManager
                        .FindFragmentById(Resource.Id.map3)).MapView.Controller;
                mMapController3.SetMapStatus(NewMapStatusWithGeoPointAndZoom(GEO_GUANGZHOU, 10));
            }

            // 深圳市
            if (mMapController4 == null)
            {
                mMapController4 = Android.Runtime.Extensions.JavaCast<SupportMapFragment>(SupportFragmentManager
                        .FindFragmentById(Resource.Id.map4)).MapView.Controller;
                mMapController4.SetMapStatus(NewMapStatusWithGeoPointAndZoom(GEO_SHENGZHENG, 10));
            }
        }