在Google地图中显示Shapefile

时间:2013-03-20 16:10:19

标签: c# google-maps asp.net-mvc-4 sharpmap

我正在尝试使用SharpMap库在Google地图中显示Shapefile。我正在使用ASP.NET MVC4。这是我的控制者:

public class HomeController : Controller
{
    public ActionResult InitSharpFiles()
    {
        SharpMap.Layers.VectorLayer vlayer = new SharpMap.Layers.VectorLayer("streets");
        vlayer.DataSource = new SharpMap.Data.Providers.ShapeFile("Content/streets.shp", true);

        return View(vlayer);
    }

    public ActionResult Index()
    {

        return View();
    }
}

我想在可能的情况下在Google地图中加载此Shapefile,但我不知道如何继续,因为有关Sharpmap的文档并不多。下一个代码是加载地图的地方:

<body onload="getMap()">
<div id="map-canvas" style="width:1200px; height:800px; margin:auto"></div>

我不知道在控制器中使用创建的SharpMap做什么以及如何将此数据传递给视图。如何将Shapefile显示到Google地图中?

更多信息:
我有一个大约100MB的.SHP文件和一个大约200MB的.DBF文件,转换为KML大约450MB。什么更容易使用,KML或Shapefile?我希望这些数据显示在Google地图中。我尝试使用FusionTables,但这仅限于100MB。

0 个答案:

没有答案
相关问题