private void button2_Click(object sender, EventArgs e) { var tmp = this.checkedListBox1.SelectedItem; if (tmp is MangoVectorLayer) { MangoVectorLayer layer = (MangoVectorLayer)tmp; LayerProperty p = new LayerProperty(layer); if (p.ShowDialog() == DialogResult.OK) { map.InvokeOnLayerChanged(layer); } return; } if (tmp is MangoLabelLayer) { MangoLabelLayer layer = tmp as MangoLabelLayer; LabelLayerProperty p = new LabelLayerProperty(layer.Layer); if (p.ShowDialog() == DialogResult.OK) { map.InvokeOnLayerChanged(layer); } return; } }
public LayerProperty(MangoVectorLayer layer) { InitializeComponent(); this.layer = layer as MangoVectorLayer; this.color = ParseUtil.ParseColor((layer.Layer.color)); this.LoadTextureList(); this.Load += LayerProperty_Load; }
public ILayer AddLabelLayer(string name, MangoVectorLayer layer) { MangoLabelLayer lLayer = new MangoLabelLayer(layer.Layer, name); lLayer.DataSource = (layer).DataSource; lLayer.Enabled = true; lLayer.LabelColumn = "Name"; lLayer.RenderPrepare(); mapBox1.Map.Layers.Add(lLayer); return(lLayer); }
public ILayer LoadShapeFileLayer(MangoLayer layer) { if (layer.filenamePrefix == null || layer.filenamePrefix == "") { return(null); } string filename = MAP_PATH + layer.filenamePrefix; // 默认载入文件名, .shp 为层文件名,每个图层包括前缀名+ (.shp,.dbf,.sbx 等若干文件) if (!System.IO.File.Exists(filename)) { return(null); } ShapeFile shapeFileData = new ShapeFile(filename); MangoVectorLayer shapeFileLayer = new MangoVectorLayer(layer, shapeFileData); shapeFileLayer.RenderPrepare(); this.mapBox1.Map.Layers.Add(shapeFileLayer); return(shapeFileLayer); }