Closed mudhutnm closed 4 years ago
The Map.to_html()
function inherits from ipyleaflet. Unfortunately, custom widgets like the legend are not supported. See https://github.com/jupyter-widgets/ipyleaflet/issues/592
The
Map.to_html()
function inherits from ipyleaflet. Unfortunately, custom widgets like the legend are not supported. See jupyter-widgets/ipyleaflet#592
hi there I am using GEE to display data on map. Now I am developing a website using Django for this purpose but with Map.to_html(), I can not use tool bar, inspesctor tool, plot,.... Is there any way to render geemap.Map() in Django to keep these widgets and the map thorough interactivity?
Description
When I converted a map to HTML, the Legend doesnot get included in the HTML file.
What I Did
Source for this code: Add customized legends
https://github.com/giswqs/geemap/blob/master/examples/notebooks/00_geemap_key_features.ipynb
import geemap import ee
Map = geemap.Map() Map.add_basemap('HYBRID') landcover = ee.Image('USGS/NLCD/NLCD2016').select('landcover') Map.addLayer(landcover, {}, 'NLCD Land Cover') Map.add_legend(builtin_legend='NLCD') Map
Make an HTML File
Map.to_html(r'C:\Users\dsand_000\GEE\NLCD_Map_with_Legend.html', title='NLCD Map', width='60%', height='528px')
Remaining issue - the legend does not get exported to the HTML file.