2

I'm trying to display a Shapefile in Google Maps with the library SharpMap. I'm using ASP.NET MVC4. This is my controller:

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();
    }
}

I want to load this Shapefile in Google Maps if possible but I don't know how to continue because the documentation about Sharpmap is not much. The next code is where Maps is loaded:

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

I don't know what to do in the controller with the created SharpMap and how to pass this data to the view. How can I display the Shapefiles into Google Maps?

More information:
I have a .SHP file that is about 100MB and a .DBF file that is about 200MB, converted to KML it's about 450MB. What is easier to use, KML or Shapefiles? I want this data to show in Google Maps. I tried to use FusionTables but this is limited to 100MB.

Ronald Meijboom
  • 1,534
  • 3
  • 17
  • 37
  • I am wanting to do the same thing, got any solutions? Could you please help me @ronaldm – rysahara Jul 16 '14 at 01:02
  • No, we didn't fix this for our school project. We used a different approach by inserting the streets into a database which we then used. Good luck! – Ronald Meijboom Jul 16 '14 at 08:23

0 Answers0