Map Providers in EJ 1 ASP.NET MVC Maps

14 Aug 2017 / 1 minute to read

Map control support map providers such as OpenStreetMap that can be added to any layers in maps.

Open Street Map

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.

Enable OSM

You can enable this feature by setting the LayerType property value as “OSM”.

  • cshtml
  • @(Html.EJ().Map("map")
    
    	.Layers(layer =>
    
    	{
    
    		layer.LayerType(Syncfusion.JavaScript.DataVisualization.Models.LayerType.OSM)
    
    		.UrlTemplate("http://a.tile.openstreetmap.org/level/tileX/tileY.png”);
    
    	})           
    
    	)

    URL Template

    The UrlTemplate property determines the format of tile map. You can specify the template for the tile layer.

    Map-Providers_img1

    Bing Map

    Bing Map is a key feature in accessing the external geospatial imagery services for deep-zoom satellite view.

    Enable Bing Maps

    You can enable this feature by defining the LayerType as “Bing”.

  • cshtml
  • @(Html.EJ().Map("map")
    
    	.Layers(layer =>
    
    	{
    
    		layer.LayerType(Syncfusion.JavaScript.DataVisualization.Models.LayerType.Bing)
    
    		.Key("// ...bingMapKey”).Add();
    
    	})           
    
    	)

    Key

    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.

    Map-Providers_img2