Search results

Print and export

Print

The rendered maps can be printed directly from browser by calling the public method Print. You can get the Maps component object using @ref="maps".

@using Syncfusion.EJ2.Blazor.Maps

<button @onclick="PrintMap">Print</button>
@*  To create reference  *@
<EjsMaps @ref="maps">
    <MapsLayers>
        <MapsLayer ShapeData='new {dataOptions= "https://cdn.syncfusion.com/maps/map-data/world-map.json"}'>
            <MapsLayerTooltipSettings Visible="true"
                                  ValuePath="name">
            </MapsLayerTooltipSettings>
        </MapsLayer>
    </MapsLayers>
</EjsMaps>

@code {
    EjsMaps maps;
    void PrintMap()
    {
        // using Maps component reference call 'Print' method
        maps.Print();
    }
}

Maps with print option

Export

The rendered maps can be exported in the following formats using the export method. The input parameters for this method are export type for format and file name of result.

  • PNG
  • JPEG
  • SVG
  • PDF
@using Syncfusion.EJ2.Blazor.Maps

<button @onclick="ExportMap">Export</button>
<EjsMaps @ref="maps">
    <MapsLayers>
        <MapsLayer ShapeData='new {dataOptions= "https://cdn.syncfusion.com/maps/map-data/world-map.json"}'>
        </MapsLayer>
    </MapsLayers>
</EjsMaps>

@code {
    EjsMaps maps;
    void ExportMap()
    {
        maps.Export(ExportType.PNG, "World Map");
    }
}

Maps with export option

Contents
Contents