# ASP.NET Core Map Overview

The Telerik UI Map TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Map widget.

The Map displays geospatial information organized in layers and is supported for both desktop and mobile devices. It also provides tile layers, shape (vector) layers, and marker layers.

* [Demo page for the Map HtmlHelper](https://demos.telerik.com/aspnet-core/map/index)

* [Demo page for the Map TagHelper](https://demos.telerik.com/aspnet-core/map/tag-helper)

## Initializing the Map

The following example demonstrates how to define the Map. The attribution text is HTML-encoded and cannot contain markup.

```Razor HtmlHelper
    @(Html.Kendo().Map()
        .Name("map")
        .Center(35.268107, -95.744821)
        .Zoom(2)
        .Layers(layers =>
        {
            layers.Add()
                .Type(MapLayerType.Tile)
                .UrlTemplate("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
                .Subdomains("a", "b", "c")
                .Attribution("\u00A9 OpenStreetMap contributors");
        })
        .Markers(markers =>
        {
            markers.Add()
                .Location(30.268107, -97.744821)
                .Shape(MapMarkersShape.PinTarget)
                .Tooltip(tooltip => tooltip.Content("Austin, TX"));
        })
    )
```

```Razor TagHelper
    @{
        var centerCoordinates = new double[] { 35.268107, -95.744821 };
        var locationCoordinates = new double[] { 30.268107, -97.744821 };
        var subdomains = new string[] { "a", "b", "c" };
    }

    <kendo-map name="map" center="centerCoordinates" zoom="2">
        <layers>
            <layer type="MapLayerType.Tile"
                   url-template="https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                   subdomains="subdomains"
                   attribution="@("\u00A9 OpenStreetMap contributors")">
            </layer>
        </layers>
        <markers>
            <map-marker location="locationCoordinates" shape="MapMarkersShape.PinTarget">
                <tooltip content="Austin, TX"></tooltip>
            </map-marker>
        </markers>
    </kendo-map>
```

```C# Controller
    public partial class MapController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }
    }
```

## Basic Configuration

The following example demonstrates the basic configuration for the Map component.

```Razor HtmlHelper
    @(Html.Kendo().Map()
        .Name("map")
        .Center(30.268107, -97.744821)
        .Zoom(3)
        .Layers(layers =>
        {
            layers.Add()
                .Type(MapLayerType.Bing)
                .ImagerySet(MapLayersImagerySet.AerialWithLabels)
                .Key("AqaPuZWytKRUA8Nm5nqvXHWGL8BDCXvK8onCl2PkC581Zp3T_fYAQBiwIphJbRAK");
        })
        .Markers(markers =>
        {
            markers.Add()
                .Location(30.268107, -97.744821)
                .Shape(MapMarkersShape.PinTarget)
                .Tooltip(tooltip => tooltip.Content("Austin, TX"));
        })
    )
```

```Razor TagHelper
    @{
        var coordinates = new double[] { 30.268107, -97.744821 };
    }

    <kendo-map name="map" center="coordinates" zoom="3">
        <layer-defaults>
            <map-marker>
                <tooltip>
                    <popup-animation>
                        <open duration="1200" effects="zoom:in" />
                    </popup-animation>
                </tooltip>
            </map-marker>
        </layer-defaults>
        <markers>
            <map-marker location="coordinates"  shape="MapMarkersShape.PinTarget">
                <tooltip content="Austin, TX"></tooltip>
            </map-marker>
        </markers>
        <layers>
            <layer type="MapLayerType.Bing"
                imagery-set="MapLayersImagerySet.AerialWithLabels"
                key="AqaPuZWytKRUA8Nm5nqvXHWGL8BDCXvK8onCl2PkC581Zp3T_fYAQBiwIphJbRAK">
            </layer>
        </layers>
    </kendo-map>
```

## Next Steps

* [Getting Started with the Map](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/diagrams-and-maps/map/getting-started)
* [Basic Usage of the Map for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/map/index)
* [Azure Tile Layout of the Map for ASP.NET Core](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/diagrams-and-maps/map/azure-tiles)
* [Map Events](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/diagrams-and-maps/map/events)

## See Also

* [Basic Usage of the Map HtmlHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/map/index)

* [Basic Usage of the Map TagHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/map/tag-helper)

* [Server-Side API of the Map for ASP.NET Core](https://www.telerik.com/aspnet-core-ui/documentation/api/map)
