OSM Viewer
Contents
[
Hide
]
使用 Aspose.GIS for .NET 库来实现 OSM 查看器。
实时示例
Aspose.GIS for .NET / C# 在线免费提供 “OSM Viewer” 应用程序,您可以在其中调查其功能和质量如何运作。
代码示例 - OSM Viewer
以下代码片段向您展示了如何实现 OSM 查看器。下面的代码使用 OSM 层创建图像地图。如果您为地图指定空间参考系统,所有加载的图层都将转换为它。 该样本使用指定的样式绘制线条。该库还具有用于点、线和面的样式。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
// Create a map | |
using (var map = new Map(800, 400)) | |
{ | |
// Use the specified SRS | |
map.SpatialReferenceSystem = SpatialReferenceSystem.Wgs84; | |
// Use the specified style to draw lines | |
// We also have styles for points, lines, and surfaces. | |
var symbolizer = new SimpleLine() {Width = Measurement.Pixels(2)}; | |
// Open a layer and add to the map | |
map.Add(VectorLayer.Open("land.osm", Drivers.OsmXml), symbolizer); | |
// Render the map | |
map.Render("land_out.png", Renderers.Png); | |
} |
此示例显示了常规可能性。Aspose.GIS for .NET 具有广泛的功能来 渲染地图。
平台 - .NET / C#
我们支持 Windows 下的 Framework 4.7 或更高版本,以及 Windows 或 Linux 下的 .NET Core 2.0 或更高版本。