@@ -131,11 +131,25 @@ def easting_northing_to_lon_lat(easting, northing):
131131 )
132132}
133133
134+ def deprecation_warning (name , url , reason ):
135+ def deprecated_tilesource_warning ():
136+ if util .config .raise_deprecated_tilesource_exception :
137+ raise DeprecationWarning ('%s tile source is deprecated: %s' % (name , reason ))
138+ param .main .param .warning ('%s tile source is deprecated and is likely to be unusable: %s' % (name , reason ))
139+ return Tiles (url , name = name )
140+ return deprecated_tilesource_warning
141+
142+
134143# CartoDB basemaps
135144CartoDark = lambda : Tiles ('https://cartodb-basemaps-4.global.ssl.fastly.net/dark_all/{Z}/{X}/{Y}.png' , name = "CartoDark" )
136- CartoEco = lambda : Tiles ('https://3.api.cartocdn.com/base-eco/{Z}/{X}/{Y}.png' , name = "CartoEco" )
137145CartoLight = lambda : Tiles ('https://cartodb-basemaps-4.global.ssl.fastly.net/light_all/{Z}/{X}/{Y}.png' , name = "CartoLight" )
138- CartoMidnight = lambda : Tiles ('https://3.api.cartocdn.com/base-midnight/{Z}/{X}/{Y}.png' , name = "CartoMidnight" )
146+ CartoMidnight = deprecation_warning ('CartoMidnight' ,
147+ 'https://3.api.cartocdn.com/base-midnight/{Z}/{X}/{Y}.png' ,
148+ 'no longer publicly available.' )
149+ CartoEco = deprecation_warning ('CartoEco' ,
150+ 'https://3.api.cartocdn.com/base-eco/{Z}/{X}/{Y}.png' ,
151+ 'no longer publicly available.' )
152+
139153
140154# Stamen basemaps
141155StamenTerrain = lambda : Tiles ('https://stamen-tiles.a.ssl.fastly.net/terrain/{Z}/{X}/{Y}.png' , name = "StamenTerrain" )
@@ -157,8 +171,23 @@ def easting_northing_to_lon_lat(easting, northing):
157171EsriReference = lambda : Tiles ('https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{Z}/{Y}/{X}' , name = "EsriReference" )
158172ESRI = EsriImagery # For backwards compatibility with gv 1.5
159173
174+
175+ def wikimedia_replacement ():
176+ if util .config .raise_deprecated_tilesource_exception :
177+ raise DeprecationWarning ('Wikipedia tile source no longer available outside '
178+ 'wikimedia domain as of April 2021.' )
179+
180+ param .main .param .warning ('Wikipedia tile source no longer available outside '
181+ 'wikimedia domain as of April 2021; switching '
182+ 'to OpenStreetMap (OSM) tile source. '
183+ 'See release notes for HoloViews'
184+ ' 1.14.4 for more details' )
185+ return Tiles ('https://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png' , name = "OSM" )
186+
160187# Miscellaneous
161188OSM = lambda : Tiles ('https://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png' , name = "OSM" )
162- Wikipedia = lambda : Tiles ( 'https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png' , name = "Wikipedia" )
189+ Wikipedia = wikimedia_replacement
163190
164- tile_sources = {k : v for k , v in locals ().items () if isinstance (v , FunctionType ) and k not in ['ESRI' , 'lon_lat_to_easting_northing' , 'easting_northing_to_lon_lat' ]}
191+ tile_sources = {k : v for k , v in locals ().items () if isinstance (v , FunctionType ) and k not in
192+ ['ESRI' , 'lon_lat_to_easting_northing' , 'easting_northing_to_lon_lat' ,
193+ 'deprecation_warning' , 'wikimedia_replacement' ]}
0 commit comments