You will find 215 maps in the companion package echarts4r.maps. However, since you may need different kinds of maps i.e.: at the citiy or county level that are not included in this package, you may need to get the detailed map data from third-party source such as This document shows how to make your own GeoJSON file which can be used in e_map_register.


These are packages to help you building such maps

  • sp: spatial data management package.
  • raster: get spatial data from
  • geojsonio: convert spatial data into json format.
  • rmapshaper: simplify the spatial data.


Get India map data from gadm website, this command need network available, it will download the rds data to the current directory.

india_sp <- raster::getData('GADM', country = 'INDIA', level = 2) # 
india_sp %>% 
  head() %>% 
1 IND India IND.1_1 Andaman and Nicobar NA IND.1.1_1 Nicobar Islands NA NA District District NA IN.AN.NI
2 IND India IND.1_1 Andaman and Nicobar NA IND.1.2_1 North and Middle Andaman NA NA District District NA IN.AN.NM
3 IND India IND.1_1 Andaman and Nicobar NA IND.1.3_1 South Andaman NA NA District District NA IN.AN.SA
214 IND India IND.2_1 Andhra Pradesh NA IND.2.1_1 Anantapur Anantpur, Ananthapur NA District District NA IN.AD.AN
219 IND India IND.2_1 Andhra Pradesh NA IND.2.2_1 Chittoor Chitoor|Chittor NA District District NA IN.AD.CH
220 IND India IND.2_1 Andhra Pradesh NA IND.2.3_1 East Godavari NA NA District District NA IN.AD.EG

Note that you can then combine maps with raster::union(map1, map2) or with the em_maps function from the echarts4r.maps package. Then convert the SpatialPolygonsDataFrame into GeoJSON with geojsonio: this will take a long time as the map is very detailed.

Therefore we can simplify the map to make it smaller.

india_small <- rmapshaper::ms_simplify(india_sp, keep = 0.05) 
india_json_small <- geojsonio::geojson_list(india_small)
print(object.size(india_json_small), units = "Mb") 
#> 6.9 Mb

Before we use the GeoJSON there is a tiny adjustement to make; ECharts (JavaScript side) expects each property to have a name attribute which it currently does not have. The map will display without it but the tooltip will not work properly without.

Now we can use the GeoJSON with e_map_register.

# plot 
e_charts() %>%
  e_map_register("India_small", india_json_small) %>%
  e_map(map = "India_small")