from localtileserver import examples, get_leaflet_tile_layer, TileClient
from ipyleaflet import Map
# Create a tile server from an raster URL
oam = TileClient('https://oin-hotosm.s3.amazonaws.com/59c66c5223c8440011d7b1e4/0/7ad397c0-bba2-4f98-a08a-931ec3a6e943.tif')
# Create ipyleaflet TileLayer from that server
# Please note that all extra kwargs are passed to `TileLayer`
oam_layer = get_leaflet_tile_layer(oam, max_zoom=30, max_native_zoom=30, show_loading=True)
# Create ipyleaflet map, add layers, add controls, and display
m = Map(center=oam.center(), zoom=18)
m.add(oam_layer)
m