Exemplo n.º 1
0
        //시설물편집창
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            EditWinView view = new EditWinView();

            if (view.ShowDialog() is bool)
            {
                //재조회
                mapControl.Refresh();

                //심볼초기화
                CmmObj.InitUniqueValueRendererObj();
            }
        }
Exemplo n.º 2
0
        public MapArcObjViewModel()
        {
            loadedCmd = new RelayCommand <object>(delegate(object obj)
            {
                //뷰객체를 파라미터로 전달받기
                mapArcObjView = obj as UserControl;

                mapHost     = mapArcObjView.FindName("mapHost") as WindowsFormsHost;
                toolbarHost = mapArcObjView.FindName("toolbarHost") as WindowsFormsHost;
                treeLayer   = mapArcObjView.FindName("treeLayer") as TreeView;

                mapControl     = mapHost.Child as AxMapControl;
                toolbarControl = toolbarHost.Child as AxToolbarControl;


                //0.맵 초기화
                initMap();

                //1.레이어초기화
                CmmObj.initLayers();

                //2.UniqueRenderer 초기화
                CmmObj.InitUniqueValueRendererObj();

                //3.행정구역경계표시
                ShowShapeLayer("BML_GADM_AS", true);


                //맵마우스클릭 이벤트설정
                mapControl.OnMouseUp += OnMouseClick;
            });


            //레이어 ON/OFF
            chkCmd = new RelayCommand <object>(delegate(object obj)
            {
                Button doc = obj as Button;

                CheckBox chkbox = doc.Template.FindName("chkLayer", doc) as CheckBox;
                bool chk        = (bool)chkbox.IsChecked;


                //ShowShapeLayer( doc.Tag.ToString(), chk);
                ShowShapeLayer(doc.Tag.ToString(), chk);


                //선택된 레이어저장
                try
                {
                    if (chk)
                    {
                        _selectedLayerNms.Add(doc.Tag.ToString());
                        _selectedLayerNm = doc.Tag.ToString();
                    }
                    else
                    {
                        _selectedLayerNms.Remove(doc.Tag.ToString());
                        _selectedLayerNm = _selectedLayerNms.LastOrDefault();
                    }
                }
                catch (Exception) { }
            });


            //GIS초기화
            resetCmd = new RelayCommand <object>(async delegate(object obj) {
                string stat = await resetAction(obj);
            });

            //SHP파일관리창
            importCmd = new RelayCommand <object>(async delegate(object obj) {
                ShpMngView view = new ShpMngView();
                if (view.ShowDialog() is bool)
                {
                    //재조회
                    string stat = await resetAction(null);
                }
            });
        }