The maps control supports map providers such as OpenStreetMap that can be added to any layers in maps.
OpenStreetMap
is a map of the entire world. The OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from any place on the earth.
You can enable this feature by setting the value of the layerType property value to “OSM” as illustrated in the following code example.
@using Syncfusion.EJ2;
@Html.EJS().Maps("maps").Layers(l=> {
l.LayerType(Syncfusion.EJ2.Maps.ShapeLayerType.OSM).UrlTemplate("http://a.tile.openstreetmap.org/level/tileX/tileY.png").Add();
}).Render()
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
The urlTemplate
property determines the format of tile map. You can specify the template for the tile layer.
Bing map is a key feature in accessing the external geospatial imagery services for deep-zoom satellite view.
You can enable this feature by defining the layerType to “bing”. The type of Bing map can be rendered as aerial, aerialwithlabel and road.
@using Syncfusion.EJ2;
@Html.EJS().Maps("maps").Layers(l=> {
l.LayerType(Syncfusion.EJ2.Maps.ShapeLayerType.Bing).BingMapType(Syncfusion.EJ2.Maps.BingMapType.AerialWithLabel).Key("// …bingMapKey").Add();
}).Render()
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
The Bing map key is provided as input to this key property. The Bing map key can be obtained from http://www.microsoft.com/maps/create-a-bing-maps-key.aspx.