ee_tile_layers module¶
Tile layers that show EE objects.
EEFoliumTileLayer (TileLayer)
¶
A Folium raster TileLayer that shows an EE object.
Source code in geemap/ee_tile_layers.py
class EEFoliumTileLayer(folium.raster_layers.TileLayer):
"""A Folium raster TileLayer that shows an EE object."""
def __init__(
self,
ee_object,
vis_params=None,
name="Layer untitled",
shown=True,
opacity=1.0,
**kwargs,
):
"""Initialize the folium tile layer.
Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params (dict, optional): The visualization parameters. Defaults to None.
name (str, optional): The name of the layer. Defaults to 'Layer untitled'.
shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True.
opacity (float, optional): The layer's opacity represented as a number between 0 and 1. Defaults to 1.
"""
self.url_format = _get_tile_url_format(
ee_object, _validate_vis_params(vis_params)
)
super().__init__(
tiles=self.url_format,
attr="Google Earth Engine",
name=name,
overlay=True,
control=True,
show=shown,
opacity=opacity,
max_zoom=24,
**kwargs,
)
__init__(self, ee_object, vis_params=None, name='Layer untitled', shown=True, opacity=1.0, **kwargs)
special
¶
Initialize the folium tile layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ee_object |
Collection|Feature|Image|MapId |
The object to add to the map. |
required |
vis_params |
dict |
The visualization parameters. Defaults to None. |
None |
name |
str |
The name of the layer. Defaults to 'Layer untitled'. |
'Layer untitled' |
shown |
bool |
A flag indicating whether the layer should be on by default. Defaults to True. |
True |
opacity |
float |
The layer's opacity represented as a number between 0 and 1. Defaults to 1. |
1.0 |
Source code in geemap/ee_tile_layers.py
def __init__(
self,
ee_object,
vis_params=None,
name="Layer untitled",
shown=True,
opacity=1.0,
**kwargs,
):
"""Initialize the folium tile layer.
Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params (dict, optional): The visualization parameters. Defaults to None.
name (str, optional): The name of the layer. Defaults to 'Layer untitled'.
shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True.
opacity (float, optional): The layer's opacity represented as a number between 0 and 1. Defaults to 1.
"""
self.url_format = _get_tile_url_format(
ee_object, _validate_vis_params(vis_params)
)
super().__init__(
tiles=self.url_format,
attr="Google Earth Engine",
name=name,
overlay=True,
control=True,
show=shown,
opacity=opacity,
max_zoom=24,
**kwargs,
)
EELeafletTileLayer (TileLayer)
¶
An ipyleaflet TileLayer that shows an EE object.
Source code in geemap/ee_tile_layers.py
class EELeafletTileLayer(ipyleaflet.TileLayer):
"""An ipyleaflet TileLayer that shows an EE object."""
def __init__(
self,
ee_object,
vis_params=None,
name="Layer untitled",
shown=True,
opacity=1.0,
**kwargs,
):
"""Initialize the ipyleaflet tile layer.
Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params (dict, optional): The visualization parameters. Defaults to None.
name (str, optional): The name of the layer. Defaults to 'Layer untitled'.
shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True.
opacity (float, optional): The layer's opacity represented as a number between 0 and 1. Defaults to 1.
"""
self.url_format = _get_tile_url_format(
ee_object, _validate_vis_params(vis_params)
)
super().__init__(
url=self.url_format,
attribution="Google Earth Engine",
name=name,
opacity=opacity,
visible=shown,
max_zoom=24,
**kwargs,
)
__init__(self, ee_object, vis_params=None, name='Layer untitled', shown=True, opacity=1.0, **kwargs)
special
¶
Initialize the ipyleaflet tile layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ee_object |
Collection|Feature|Image|MapId |
The object to add to the map. |
required |
vis_params |
dict |
The visualization parameters. Defaults to None. |
None |
name |
str |
The name of the layer. Defaults to 'Layer untitled'. |
'Layer untitled' |
shown |
bool |
A flag indicating whether the layer should be on by default. Defaults to True. |
True |
opacity |
float |
The layer's opacity represented as a number between 0 and 1. Defaults to 1. |
1.0 |
Source code in geemap/ee_tile_layers.py
def __init__(
self,
ee_object,
vis_params=None,
name="Layer untitled",
shown=True,
opacity=1.0,
**kwargs,
):
"""Initialize the ipyleaflet tile layer.
Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params (dict, optional): The visualization parameters. Defaults to None.
name (str, optional): The name of the layer. Defaults to 'Layer untitled'.
shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True.
opacity (float, optional): The layer's opacity represented as a number between 0 and 1. Defaults to 1.
"""
self.url_format = _get_tile_url_format(
ee_object, _validate_vis_params(vis_params)
)
super().__init__(
url=self.url_format,
attribution="Google Earth Engine",
name=name,
opacity=opacity,
visible=shown,
max_zoom=24,
**kwargs,
)
Created: 2023-07-03