本文整理汇总了C#中SharpMap.Map.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Map.Dispose方法的具体用法?C# Map.Dispose怎么用?C# Map.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpMap.Map
的用法示例。
在下文中一共展示了Map.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowMap
public void ShowMap(Map map)
{
MapControl.Map = map;
map.ZoomToExtents();
MapControl.MouseMove += delegate(object sender, MouseEventArgs e)
{
var point = map.ImageToWorld(new PointF(e.X, e.Y));
coordinateLabel.Text = string.Format("{0}:{1}", point.X, point.Y);
};
WindowsFormsTestHelper.ShowModal(this);
map.Dispose();
}
示例2: GetMap_GeometryProvider_ReturnImage
public void GetMap_GeometryProvider_ReturnImage()
{
Map map = new Map(new Size(400, 200));
VectorLayer vLayer = new VectorLayer("Geom layer", CreateDatasource());
vLayer.Style.Outline = new Pen(Color.Red, 2f);
vLayer.Style.EnableOutline = true;
vLayer.Style.Line = new Pen(Color.Green, 2f);
vLayer.Style.Fill = Brushes.Yellow;
map.Layers.Add(vLayer);
VectorLayer vLayer2 = new VectorLayer("Geom layer 2", vLayer.DataSource);
vLayer2.Style.SymbolOffset = new PointF(3, 4);
vLayer2.Style.SymbolRotation = 45;
vLayer2.Style.SymbolScale = 0.4f;
map.Layers.Add(vLayer2);
VectorLayer vLayer3 = new VectorLayer("Geom layer 3", vLayer.DataSource);
vLayer3.Style.SymbolOffset = new PointF(3, 4);
vLayer3.Style.SymbolRotation = 45;
map.Layers.Add(vLayer3);
VectorLayer vLayer4 = new VectorLayer("Geom layer 4", vLayer.DataSource);
vLayer4.Style.SymbolOffset = new PointF(3, 4);
vLayer4.Style.SymbolScale = 0.4f;
vLayer4.ClippingEnabled = true;
map.Layers.Add(vLayer4);
map.ZoomToExtents();
Image img = map.GetMap();
Assert.IsNotNull(img);
map.Dispose();
img.Dispose();
}
示例3: GenerateSegmentsForNetworkCoverageOnTwoBranches
public void GenerateSegmentsForNetworkCoverageOnTwoBranches()
{
var network = CreateNetwork();
var networkCoverage = new NetworkCoverage { Network = network, SegmentGenerationMethod = SegmentGenerationMethod.RouteBetweenLocations };
networkCoverage[new NetworkLocation(network.Branches[0], 10.0)] = 0.0;
networkCoverage[new NetworkLocation(network.Branches[0], 90.0)] = 90.0;
networkCoverage[new NetworkLocation(network.Branches[1], 10.0)] = 110.0;
networkCoverage[new NetworkLocation(network.Branches[1], 90.0)] = 190.0;
Assert.AreEqual(4, networkCoverage.Segments.Values.Count);
var segments = networkCoverage.Segments.Values;
Assert.AreEqual(network.Branches[0], segments[0].Branch);
Assert.AreEqual(10.0, segments[0].Chainage);
Assert.AreEqual(80.0, segments[0].Length);
Assert.AreEqual(network.Branches[0], segments[1].Branch);
Assert.AreEqual(90.0, segments[1].Chainage);
Assert.AreEqual(10.0, segments[1].Length, 1e-6);
Assert.AreEqual(network.Branches[1], segments[2].Branch);
Assert.AreEqual(0.0, segments[2].Chainage);
Assert.AreEqual(10.0, segments[2].Length);
Assert.AreEqual(network.Branches[1], segments[3].Branch);
Assert.AreEqual(10.0, segments[3].Chainage);
Assert.AreEqual(80.0, segments[3].Length);
var networkCoverageLayer = new NetworkCoverageGroupLayer { NetworkCoverage = networkCoverage };
var map = new Map(new Size(1000, 1000));
map.Layers.Add(networkCoverageLayer);
NetworkCoverageGroupLayer.SetupRouteLayerTheme(networkCoverageLayer, null);
// add branch/node layers
var branchLayer = new VectorLayer { DataSource = new FeatureCollection { Features = (IList)network.Branches } };
map.Layers.Add(branchLayer);
var nodeLayer = new VectorLayer { DataSource = new FeatureCollection { Features = (IList)network.Nodes } };
map.Layers.Add(nodeLayer);
MapTestHelper.ShowModal(map);
map.Dispose();
}