添加代码后,评论一直提交不了,只能文字叙述
Layer provinceLayer = mapControl.Map.Layers.Add(datasetProvince, setting, true); ThemeUnique railTheme = RailwayLineStyle(); mapControl.Map.Layers.Add(workspace.Datasources[0].Datasets["railway"], railTheme, true); string mapXML = mapControl.Map.ToXML(); //workspace.Maps.SetMapXML("DynamicMap", mapXML); // 存到工作空间 mapLayoutControl.MapLayout.Paper.Size = PaperSize.A4; mapLayoutControl.MapLayout.Paper.Orientation = PaperOrientation.Landscape; GeoMap geoMap = new GeoMap { MapXML = mapXML, // 直接用内存 XML ID = 1, Shape = new GeoRectangle(mapLayoutControl.MapLayout.Bounds.Center, 2500,1500, 0), }; mapLayoutControl.MapLayout.Elements.AddNew(geoMap); mapControl.Map.Zoom(4); mapLayoutControl.MapLayout.Zoom(4); if (mapControl.Map.Bounds.IsEmpty) { mapControl.Map.ViewEntire(); } if (geoMap == null) return; // 4. 刷新布局 mapLayoutControl.MapLayout.Refresh(); this.mapLayoutControl.LayoutAction = SuperMap.UI.Action.Pan; mapControl.Map.Refresh(); // 控件刷新 mapLayoutControl.MapLayout.Refresh(); // 布局刷新
新问题已在http://ask.supermap.com/158837回复