Search results

Print and Export

Print

The rendered map can be printed directly from the browser by calling the public method print. ID of the map div element must be passed as argument to that method.

tagHelper
print.cs
@using Syncfusion.EJ2;
  <ejs-maps id="maps" height="450px" width="650px">
        <e-layers>
            <e-layer shapeData="ViewBag.usmap" shapeDataPath="name" shapePropertyPath="name" dataSource="ViewBag.populationData"></e-layer>
        </e-layers>
    </ejs-maps>
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()
        {
            ViewBag.shapeData = getusMap();
            return View();
        }        
    }
}

Export

The rendered map can be exported to jpeg or png format by using export method in map. Input parameters for this method are Export Type for format and fileName of result.

tagHelper
export.cs
@using Syncfusion.EJ2;
  <ejs-maps id="maps" height="450px" width="650px">
        <e-layers>
            <e-layer shapeData="ViewBag.usmap" shapeDataPath="name" shapePropertyPath="name" dataSource="ViewBag.populationData"></e-layer>
        </e-layers>
    </ejs-maps>
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()
        {
            ViewBag.shapeData = this.WorldMap();
            ViewBag.dataSource = this.getUNOData();
            return View();
        }        
    }
}
Contents
Contents