本文整理匯總了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();
}