private void MapExplore(object sender, EventArgs e) { XMapActions action = XMapActions.none; if ((Button)sender == bZoomIn) { action = XMapActions.zoomin; } else if ((Button)sender == bZoomOut) { action = XMapActions.zoomout; } else if ((Button)sender == bMoveUp) { action = XMapActions.moveup; } else if ((Button)sender == bMoveDown) { action = XMapActions.movedown; } else if ((Button)sender == bMoveLeft) { action = XMapActions.moveleft; } else if ((Button)sender == bMoveRight) { action = XMapActions.moveright; } view.UpdateExtent(action); UpdateMap(); }
private void BOpenShapeFile_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Shapefile文件|*.shp"; openFileDialog.RestoreDirectory = false; openFileDialog.FilterIndex = 1; openFileDialog.Multiselect = false; if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } XShapeFile sf = new XShapeFile(); layer = sf.ReadShapefile(openFileDialog.FileName); layer.DrawAttributeOrNot = false; //MessageBox.Show("读入" + layer.FeatureCount() + "个实体"); view.UpdateExtent(layer.Extent); UpdateMap(); }