I'm trying to display a layer on top of a WebGL Earth view inside an Asp.Net 5, MVC 6 website. I have no problem to do this in a desktop application, but I am totally unable to do it on the website.

I have all the data in a shapefile database, and access it with SharpMap. I create a SharpMap.Map object and provide a web method (GET) to fetch the image.

public IActionResult Zoo(string service, string version, string request, int x, int y, int z)

    if (request == "GetMap")
        Image image = MapRepository.Map.GetMap();

        return base.File(image.ToStream(ImageFormat.Png), "image/png");
        // return capabilities

However the image returned does not match the 3D globe on WebGL earth. Initially I wanted to create an WMS compliant service, but I couldn't find any working samples nor tips on how to do this.

Also, SharpMap is not updated for MVC6 and the only sample I could find won't work, since it's using the old HttpContext.

Maybe the whole approach is wrong, and I should be returning the polygons an let WebGL do the render... I'm not sure.

Currently I just need to display country borders and fill each country with a given color. If there's a better way than what I'm doing, I'd be happy to know!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.