예제 #1
0
        public void TrackPlayback(string url, string icon)
        {
            int id = 4421;

            // MessageBox.Show("123");
            ContainerManager.PlayBackBodyContainer.Visibility = Visibility.Visible;
            ContainerManager.Map.Visibility = Visibility.Collapsed;

            foreach (WindowBase item in RadWindowManager.Current.GetWindows())
            {
                item.Visibility = Visibility.Collapsed;
            }

            PlayBackBodyContainer pbbcControl = ContainerManager.PlayBackBodyContainer as PlayBackBodyContainer;

            //pbbcControl.map.Layers.Clear();
            pbbcControl.PlayBack(url, icon);
        }
예제 #2
0
        public MainPage()
        {
            InitializeComponent();
            HtmlPage.RegisterScriptableObject("MapInfo", this);
            string MapLayerType = Application.Current.Resources["mapType"] as string;

            switch (MapLayerType)
            {
            case "ArcGISTiledMap":
                ArcGISTiledMapServiceLayer layer = new ArcGISTiledMapServiceLayer();
                layer.ID      = "ArcGISTiledMap";
                layer.Url     = Application.Current.Resources["mapUrl"] as string;
                layer.Visible = true;
                this.map.Layers.Insert(0, layer);
                break;

            case "ArcGISDynamicMap":
                ArcGISDynamicMapServiceLayer arcGISDynamicMap = new ArcGISDynamicMapServiceLayer();
                arcGISDynamicMap.ID      = "ArcGISDynamicMap";
                arcGISDynamicMap.Url     = Application.Current.Resources["mapUrl"] as string;
                arcGISDynamicMap.Visible = true;
                this.map.Layers.Insert(0, arcGISDynamicMap);
                break;

            case "GoogleMap":
                GoogleMapLayer googleMapLayer = new GoogleMapLayer();
                googleMapLayer.Visible = true;
                this.map.Layers.Insert(0, googleMapLayer);
                break;

            case "GoogleSatelliteMap":
                GoogleMapSatelliteLayer googleMapSatelliteLayer = new GoogleMapSatelliteLayer();
                googleMapSatelliteLayer.Visible = true;
                this.map.Layers.Insert(0, googleMapSatelliteLayer);
                break;

            case "GoogleTerrainMap":
                GoogleMapTerrainLayer googleMapTerrainLayer = new GoogleMapTerrainLayer();
                googleMapTerrainLayer.Visible = true;
                this.map.Layers.Insert(0, googleMapTerrainLayer);
                break;

            case "TianDiTuMap":
                TianDiTuLayer tianDiTuLayer = new TianDiTuLayer();
                tianDiTuLayer.Visible = true;
                this.map.Layers.Insert(0, tianDiTuLayer);
                break;

            case "TianDiTuSatelliteMap":
                TianDiTuSatelliteLayer tianDiTuSatelliteLayer = new TianDiTuSatelliteLayer();
                tianDiTuSatelliteLayer.Visible = true;
                this.map.Layers.Insert(0, tianDiTuSatelliteLayer);
                break;

            default:
                break;
            }

            PlayBackBodyContainer playBackBodyContainer = new PlayBackBodyContainer()
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Visibility          = Visibility.Collapsed
            };

            body.Children.Add(playBackBodyContainer);
            ContainerManager.PlayBackBodyContainer = playBackBodyContainer;

            //ContainerManager.ToastTip = this.toastTip;
            ContainerManager.BodyContainer = this;
            ContainerManager.Map           = map;
            LayerManager.ElementLayer      = this.map.Layers["ElementLayer"] as ElementLayer;


            string mapExtent = Application.Current.Resources["mapExtent"] as string;

            double x1 = Convert.ToDouble(mapExtent.Split('|')[0]);
            double y1 = Convert.ToDouble(mapExtent.Split('|')[1]);
            double x2 = Convert.ToDouble(mapExtent.Split('|')[2]);
            double y2 = Convert.ToDouble(mapExtent.Split('|')[3]);



            // this.map.Extent= new Envelope((double)x1, (double)y1, (double)x2, (double)y2);
            ContainerManager.Map.Extent = new Envelope((double)x1, (double)y1, (double)x2, (double)y2);
            //Location("");
            //Round(369839.4480747870000000, 3308466.1026192900000000, 15, "");


            #region 控件版
            //ContainerManager.BodyContainer = this;
            //ContainerManager.Map = map;
            //LayerManager.ElementLayer = this.map.Layers["ElementLayer"] as ElementLayer;
            //WebAPIHelper dt = new WebAPIHelper();

            //dt.GetDataCompleted += (s, args) =>
            //{
            //    List<SystemConfig> list = args.DataResult as List<SystemConfig>;
            //    ContainerManager.SystemConfigs = list;


            //    WebAPIHelper mecDt = new WebAPIHelper();
            //    mecDt.GetDataCompleted += (a, b) =>
            //    {
            //        List<MapElementCategorie> mecList = b.DataResult as List<MapElementCategorie>;
            //        ContainerManager.MapElementCategorys = mecList;

            //        ShowMyWindow(1);



            //    };

            //    mecDt.GetDataAsync<List<MapElementCategorie>>("api/MapElementCategorie/Query");
            //};
            //string url = "api/SystemConfig/Query";

            //dt.GetDataAsync<List<SystemConfig>>(url);

            #endregion
        }