The whole map has a TileLayer = 'OpenStreetMap'. How to change the Title Layer only for the area indicated by the polygon?
import folium
X1 = 61.70029083832628
Y1 = 27.24609375
X2 = 61.68987220046
Y2 = 27.26806640625
mapObj = folium.Map(location=[X1, Y1], tiles="OpenStreetMap", zoom_start=14)
folium.Polygon(
[(X1, Y1), (X2, Y1), (X2, Y2), (X1, Y2)],
color='red',
weight=4
).add_to(mapObj)
mapObj
For example, so that the polygon has TileLayer = 'Stamen Watercolor'
leaflet-boundary-canvas
(see github.com/aparshin/leaflet-boundary-canvas) plugin that just that. It's a bit old but works also with the latest Leaflet 1.9.3.