コード例 #1
0
ファイル: MainForm.cs プロジェクト: hanchao/LandMap
        private void axSuperMap1_Tracking(object sender, AxSuperMapLib._DSuperMapEvents_TrackingEvent e)
        {
            if (this.axSuperMap1.Action == SuperMapLib.seAction.scaTrackPolyline ||
                this.axSuperMap1.Action == SuperMapLib.seAction.scaTrackPolygon)
            {
                //显示量算的距离和面积

                String measureResult = "";

                if (e.dTotalArea > 0)
                {
                    measureResult += "总面积:" + Util.formatArea(e.dTotalArea) + " ";
                }

                if (e.dCurrentLength > 0)
                {
                    measureResult += "本段距离:" + Util.formatDistance(e.dCurrentLength) + " ";
                }
                if (e.dTotalLength > 0)
                {
                    measureResult += "总距离:" + Util.formatDistance(e.dTotalLength) + " ";
                }

                this.toolStripStatusLabelMeasure.Text = measureResult;
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: hanchao/LandMap
 private void axSuperMap1_MouseDownEvent(object sender, AxSuperMapLib._DSuperMapEvents_MouseDownEvent e)
 {
     this.panelDistrict.Visible = false;
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: hanchao/LandMap
        private void axSuperMap1_AfterMapDraw(object sender, AxSuperMapLib._DSuperMapEvents_AfterMapDrawEvent e)
        {
            //地图绘制完成后动作

            if (this.m_viewState!="last"&& this.m_viewState!="next")
            {
                if (this.m_extents.Count < m_extentRecordsMax)
                {
                    this.m_extents.Add(this.axSuperMap1.ViewBounds);
                    this.m_extentNowIndex = this.m_extents.Count - 1;
                    this.m_viewState = null;
                }
                else
                {
                    this.m_extents.Add(this.axSuperMap1.ViewBounds);
                    this.m_extents.RemoveAt(0);
                    this.m_extentNowIndex = this.m_extents.Count - 1;
                    this.m_viewState = null;
                }
            }
            this.m_viewState = null;

            //同步滚动条
            refreshSlider();

            for (int i = 1; i <= this.axSuperMap1.Layers.Count; i++)
            {
                soLayer layer = this.axSuperMap1.Layers[i];
                if (layer == null || !layer.Visible)
                {
                    continue;
                }

                soDataset ds = layer.Dataset;
                if (ds == null)
                {
                    continue;
                }

                // 比最小比例尺小,不显示
                if (layer.VisibleScaleMin != 0.0 && axSuperMap1.ViewScale < layer.VisibleScaleMin )
                {
                    continue;
                }

                // 比最大比例尺大,不显示
                if (layer.VisibleScaleMax != 0.0 && axSuperMap1.ViewScale > layer.VisibleScaleMax)
                {
                    continue;
                }

                for (int j = 0; j < this.tudi_datasetNames.Length; j++)
                {
                    if (tudi_datasetNames[j].CompareTo(ds.Name) == 0)
                    {
                        this.tudi_curdatasetNameIndex = j;
                        break;
                    }
                }

            }

            this.comboBoxType.Items.Clear();
            TypeCodeNode[] nodes = this.typeCodeTable.getNodeByLevel(tudi_curdatasetNameIndex+1);
            this.comboBoxType.Items.Add(allType);
            this.comboBoxType.Items.AddRange(nodes);
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: hanchao/LandMap
        private void axSuperMap1_GeometrySelected(object sender, AxSuperMapLib._DSuperMapEvents_GeometrySelectedEvent e)
        {
            SuperMapLib.soSelection objSelection;

            objSelection = this.axSuperMap1.selection;
            if (objSelection.Count > 0)
            {
                if (propertyForm != null &&  propertyForm.Visible)
                {
                    //更新属性信息
                    propertyForm.initData(objSelection);
                }
            }
            objSelection = null;
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: hanchao/LandMap
 private void axSuperMap1_ActionChanged(object sender, AxSuperMapLib._DSuperMapEvents_ActionChangedEvent e)
 {
     refreshToolBar();
 }