Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not seeing export tool (wrench icon) on map and getting AttributeError #71

Closed
aewindle110 opened this issue May 12, 2020 · 2 comments
Closed

Comments

@aewindle110
Copy link

aewindle110 commented May 12, 2020

  • geemap version: 0.6.13.
  • Python version: 3.8.2
  • Operating System: Linux

Description

I am using JupyterLab a to run notebook example 21_export_map_to_html_png.ipynb and do not see an export (wrench) icon on my map.

When I try to run the provided code using Map.to_html and Map.to_image I get AttributeError: 'Map' object has no attribute 'to_html'.

These two issues happen on both jupyter notebook and Jupyter Lab

What I Did

Map = geemap.Map()
Map
# Add Earth Engine datasets
dem = ee.Image('USGS/SRTMGL1_003')
landcover = ee.Image("ESA/GLOBCOVER_L4_200901_200912_V2_3").select('landcover')
landsat7 = ee.Image('LE7_TOA_5YEAR/1999_2003')
states = ee.FeatureCollection("TIGER/2018/States")

# Set visualization parameters.
vis_params = {
  'min': 0,
  'max': 4000,
  'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}

# Add Earth Eninge layers to Map
Map.addLayer(dem, vis_params, 'STRM DEM', True, 0.5)
Map.addLayer(landcover, {}, 'Land cover')
Map.addLayer(landsat7, {'bands': ['B4', 'B3', 'B2'], 'min': 20, 'max': 200}, 'Landsat 7')
Map.addLayer(states, {}, "US States")
*see no icon*


#export map as html
import os
#declare where to download output
download_dir = os.path.join(os.path.expanduser('~'), 'Downloads')
html_file = os.path.join(download_dir, 'my_map.html')
Map.to_html(outfile=html_file, title='My Map', width='100%', height='880px')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-28-63cbb236e2de> in <module>
----> 1 Map.to_html(outfile=html_file, title='My Map', width='100%', height='880px')

AttributeError: 'Map' object has no attribute 'to_html'



@giswqs
Copy link
Member

giswqs commented May 12, 2020

You need to update geemap to the latest version 0.6.13 to be able to use this feature. Try running the following line in Jupyter and restart the kernel to take effect.

geemap.update_package()

@aewindle110
Copy link
Author

Ahh I was only trying to update in terminal. got it.. thank you!

@giswqs giswqs closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants