gee-community / geemap

A Python package for interactive geospatial analysis and visualization with Google Earth Engine.
https://geemap.org
MIT License
3.41k stars 1.08k forks source link

Legend does not carry over on export to html #120

Closed mudhutnm closed 4 years ago

mudhutnm commented 4 years ago

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.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
giswqs commented 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

Alihdy commented 3 months ago

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?