public StartEdit(mapcontent map)
 {
     InitializeComponent();
     this.map                  = map;
     listBox.ItemsSource       = map.layerlist;
     listBox.DisplayMemberPath = "Layername";
 }
Exemple #2
0
 public void Forward(mapcontent map)
 {
     if (curindex < list.Count - 1)
     {
         curindex++;
         list[curindex].GisForward(map);
     }
 }
Exemple #3
0
 public void SetData(mapcontent map, WriteableBitmap bitmap)
 {
     this.map        = map;
     this.background = bitmap.Clone();
     title           = new MapTitle(map.name, new Point(30, 10));
     legend          = new MapLegend(map, new Point(bitmap.Width * 3 / 4, bitmap.Height * 3 / 4));
     bmp             = background.Clone();
     Refresh();
 }
Exemple #4
0
 public void Recover(mapcontent map)
 {
     if (curindex < 0)
     {
         return;
     }
     list[curindex].GisRecover(map);
     curindex--;
 }
Exemple #5
0
        public override void GisForward(mapcontent map)
        {
            base.GisForward(map);
            Layer layer = map.GetLayerByName(this.layername);

            if (layer == null)
            {
                return;
            }
            FeatureCollection collection = layer.featuresource.features;

            collection.GetFeatureByID(createdfeatureid).visible = true;
        }
Exemple #6
0
        public override void GisRecover(mapcontent map)
        {
            base.GisRecover(map);
            Layer layer = map.GetLayerByName(this.layername);

            if (layer == null)
            {
                return;
            }
            FeatureCollection collection = layer.featuresource.features;

            foreach (int featureid in this.CopyFeatureIDs)
            {
                collection.GetFeatureByID(featureid).visible = false;
            }
        }
Exemple #7
0
        private void paintmap(Graphics g, Graphics text_g, mapcontent mapcontent)
        {
            if (mapcontent == null)
            {
                return;
            }
            List <Layer> layerlist = mapcontent.layerlist;

            for (int i = layerlist.Count - 1; i >= 0; i--)
            {
                Layer layer = layerlist[i];
                if (layer.visible)
                {
                    //获取targetSRS,sourceSRS,然后获取RSTransform对象///////????????????????????????????????????????????????
                    RSTransform rstransform = new RSTransform_WGS84_WEBMOCARTO();
                    paintLayerbyStyle(g, text_g, layer, rstransform);
                }
            }
        }
Exemple #8
0
        private void ShowTreeView(mapcontent mapcontent)
        {
            //TreeNode mapnode = new TreeNode(mapcontent.name);
            //mapnode.Checked = true;
            List <GisSmartTools.Support.Layer> layerlist = mapcontent.layerlist;

            LayerModel[] nodes = new LayerModel[layerlist.Count];
            //TreeNode[] childnodes = new TreeNode[layerlist.Count];

            treeView.Items.Clear();
            for (int i = 0; i < layerlist.Count; i++)
            {
                nodes[i] = new LayerModel(layerlist[i].Layername);
                nodes[i].PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(OnCheckItem);
                //nodes[i].Nodes.Add(GetTreeViewStyle(layerlist[i].style));
                if (layerlist[i].visible)
                {
                    nodes[i].IsChecked = true;
                }
                else
                {
                    nodes[i].IsChecked = false;
                }


                if (layerlist[i].visible)
                {
                    nodes[i].IsChecked = true;
                }
                treeView.Items.Add(nodes[i]);
            }

            //treeView.AddRange(nodes);
            //treeView1.Nodes.Clear();
            //treeView1.Nodes.Add(mapnode);
            //treeView1.ExpandAll();
        }
Exemple #9
0
        /// <summary>
        /// 该函数赋予显示参数的初值,同时可以用于显示全图的功能
        /// </summary>
        /// <param name="mapcontent"></param>
        public void SetDefaultoffsetandDisplayScale(mapcontent mapcontent)
        {
            Geometry.Rectangle rect = mapcontent.GetRefernectRectangle();
            if (rect.minX >= rect.maxX || rect.minY >= rect.maxY)
            {
                DisplayScale = 1;
                moffsetX     = 0;
                moffsetY     = 0;
                return;
            }
            double scale_x = (rect.maxX - rect.minX) / bitmap_X;
            double scale_y = (rect.maxY - rect.minY) / bitmap_Y;

            if (scale_x < scale_y)
            {
                DisplayScale = scale_y;
            }
            else
            {
                DisplayScale = scale_x;
            }
            moffsetX = rect.minX;
            moffsetY = rect.maxY;
        }
Exemple #10
0
        private void New_MouseDown(Object sender, RoutedEventArgs e)
        {
            NewMap dialog = new NewMap();

            if (dialog.ShowDialog() == true)
            {
                string name = dialog.mapName;
                //创建工程对象
                mappro          = MapProject.CreateMapProject(name);
                mappro.server   = dialog.server;
                mappro.port     = dialog.port;
                mappro.username = dialog.username;
                mappro.password = dialog.password;
                mappro.database = dialog.database;
                //创建mapcontent对象
                mapcontent mapcontent = mapcontent.createnewmapcontentofnolayer(name, dialog.server, dialog.port, dialog.username, dialog.password, dialog.database);
                gdb = mapcontent.gdb;
                mapControl.mapcontent = mapcontent;
                mapControl.mapcontrol_refresh();
                this.Title = "Mercury GIS - " + name;
                //刷新图层树
                //ShowTreeView(mapcontent);
            }
        }
Exemple #11
0
 public MapLegend(mapcontent mapcontent, Point position)
 {
     this.mapcontent = mapcontent;
     this.position   = position;
 }
Exemple #12
0
 public MapTULI(mapcontent mapcontent, PointF position)
 {
     this.mapcontent = mapcontent;
     this.position   = position;
 }
Exemple #13
0
 virtual public void GisForward(mapcontent map)
 {
 }
Exemple #14
0
 virtual public void GisRecover(mapcontent map)
 {
 }