Googlemap control for Asp.Net MVC

Googlemap control for Asp.Net MVC wraps Google maps API simplifying its use in ASP.NET Core Web applications.

Install

Inside Visual Studio create a new ASP.NET Core Web Application.

Open the package manager console and install the Googlemap Mvc nuget package by typing the following command.

PM> Install-Package Jmelosegui.Mvc.Googlemap

Once you have it go to the Pages->Index.cshtml and include the following

    @(
        Html.GoogleMap()
            .Name("map")
            .Height(500)
            .Markers(m => m.Add().Title("Hello World!")) 
    )
        

and at the end of that page add the following

    @section scripts
    {
       @(Html.GoogleMap().ScriptRegistrar())
    }
        

Don't forget to add the namespace to the very top of your page or in the _ViewImports.cshtml file.

    @using Jmelosegui.Mvc.GoogleMap
        

Now hit F5 and you should see the map rendering on the page

License

Googlemap control for Asp.Net MVC is released under the MIT LICENSE.