Skip to content

The parameter show on method Map.addLayer is not working #378

Answered by giswqs
sam125 asked this question in Q&A
Discussion options

You must be logged in to vote

Do NOT use ipyleaflet's built-in LayersControl. It has limitations. See jupyter-widgets/ipyleaflet#452. And that's the reason why I developed a new layer control for geemap. Try the revised code below. It should work as expected.

import ee
import geemap

X=-7.5
Y=38.8
Map = geemap.Map(center=[Y, X], zoom= 10)

startDate='2021-03-14'
endDate='2021-03-16'
sentinel2 = ee.ImageCollection("COPERNICUS/S2");

image= sentinel2.filterBounds(ee.Geometry.Point([X, Y])).filterDate(startDate, endDate).sort('CLOUDY_PIXEL_PERCENTAGE', True).first()

ndvi=image.normalizedDifference(['B4', 'B8'])

ndviPalette = ['red', 'yellow', 'green', 'blue']
trueColor_palette = {'bands': ['B4', 'B3', 'B2'], 'min': 0, …

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@giswqs
Comment options

@sam125
Comment options

Comment options

You must be logged in to vote
2 replies
@sam125
Comment options

@giswqs
Comment options

Answer selected by giswqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants