Articles in this section
Category / Section

How to download the rendered India map

2 mins read

How to download the rendered India map?

Export the map

The rendered EJ2 maps control can be downloaded locally and used further. This can be done by calling the export method in maps. You can export the map in the below formats.

  • PNG
  • JPEG
  • SVG
  • PDF

The input parameters for this method are export type and file name.

import { Maps, DataLabel } from '@syncfusion/ej2-maps';
import { IndiaMap } from './india';
Maps.Inject(DataLabel);
let maps: Maps = new Maps({
    layers: [
        {
            shapeData: IndiaMap,
            //..
        }
    ]
});
maps.appendTo('#container');
document.getElementById('export').onclick = () => {
    maps.export('PNG', 'Maps');
};

In the above code, on clicking a button, maps is exported in PNG format. The below screenshot shows the output of the code snippet.

A close up of a map

Description generated with high confidence

Sample link -  Export map

Print the map

In addition to exporting, you can also print the renderer maps directly from the browser by calling the print method.

import { Maps, DataLabel } from '@syncfusion/ej2-maps';
import { IndiaMap } from './india';
Maps.Inject(DataLabel);
let maps: Maps = new Maps({
    layers: [
        {
            shapeData: IndiaMap,
            //..
        }
    ]
});
maps.appendTo('#container');
document.getElementById('print').onclick = () => {
    maps.print();
};

 

A close up of a map

Description generated with high confidence

Sample link – Print map

Learn more details about printing and exporting of the maps from this UG link.

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied