You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default max_zoom of 18 wasn't quite enough for a project I was working on. I tried to add a tile layer (Google Satellite) with a higher max_zoom but the add_tile_layer only accepts url, name, attribution, opacity and shown as arguments
My temporary fix was to use fastcore to mix in my own version of the add_tile_layer function:
from fastcore.all import *
@patch
def add_tile_layer(self:geemap.Map, **kwargs):
try:
tile_layer = ipyleaflet.TileLayer(**kwargs)
self.add_layer(tile_layer)
except Exception as e:
print(e)
print("Failed to add the specified TileLayer.")
# Now we can add a layer with max_zoom or any other TileLayer arguments
Map.add_tile_layer(url="https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
attribution="Google",
name="Google Satellite",
max_zoom=24)
There are a couple of ways add_tile_layer in geemap.py could be modified to accept all the available arguments for TileLayer. Should be an easy feature to add if anyone is looking for something to work on, otherwise I'm happy to have a go once time allows.
Jonathan
geemap version: 0.7.11
Python version: 3.7.6
Operating System: Ubuntu 20.04.1
The text was updated successfully, but these errors were encountered:
Description
The default max_zoom of 18 wasn't quite enough for a project I was working on. I tried to add a tile layer (Google Satellite) with a higher max_zoom but the add_tile_layer only accepts url, name, attribution, opacity and shown as arguments
The additional ipyleaflet TileLayer options are listed at https://ipyleaflet.readthedocs.io/en/latest/api_reference/tile_layer.html. It would be nice to have a way to specify all of these arguments for more control.
What I Did
My temporary fix was to use fastcore to mix in my own version of the add_tile_layer function:
There are a couple of ways add_tile_layer in geemap.py could be modified to accept all the available arguments for TileLayer. Should be an easy feature to add if anyone is looking for something to work on, otherwise I'm happy to have a go once time allows.
Jonathan
The text was updated successfully, but these errors were encountered: