@@ -152,7 +152,8 @@ def __init__(self, location=None, width='100%', height='100%',
152152 no_wrap = False , attr = None , min_lat = - 90 , max_lat = 90 ,
153153 min_lon = - 180 , max_lon = 180 , max_bounds = True ,
154154 detect_retina = False , crs = 'EPSG3857' , control_scale = False ,
155- prefer_canvas = False , no_touch = False , disable_3d = False ):
155+ prefer_canvas = False , no_touch = False , disable_3d = False ,
156+ subdomains = 'abc' ):
156157 super (LegacyMap , self ).__init__ ()
157158 self ._name = 'Map'
158159 self ._env = ENV
@@ -192,7 +193,8 @@ def __init__(self, location=None, width='100%', height='100%',
192193 self .add_tile_layer (
193194 tiles = tiles , min_zoom = min_zoom , max_zoom = max_zoom ,
194195 continuous_world = continuous_world , no_wrap = no_wrap , attr = attr ,
195- API_key = API_key , detect_retina = detect_retina
196+ API_key = API_key , detect_retina = detect_retina ,
197+ subdomains = subdomains
196198 )
197199
198200 self ._template = Template (u"""
@@ -247,7 +249,8 @@ def _repr_html_(self, **kwargs):
247249 def add_tile_layer (self , tiles = 'OpenStreetMap' , name = None ,
248250 API_key = None , max_zoom = 18 , min_zoom = 1 ,
249251 continuous_world = False , attr = None , active = False ,
250- detect_retina = False , no_wrap = False , ** kwargs ):
252+ detect_retina = False , no_wrap = False , subdomains = 'abc' ,
253+ ** kwargs ):
251254 """
252255 Add a tile layer to the map. See TileLayer for options.
253256
@@ -257,6 +260,7 @@ def add_tile_layer(self, tiles='OpenStreetMap', name=None,
257260 attr = attr , API_key = API_key ,
258261 detect_retina = detect_retina ,
259262 continuous_world = continuous_world ,
263+ subdomains = subdomains ,
260264 no_wrap = no_wrap )
261265 self .add_child (tile_layer , name = tile_layer .tile_name )
262266
@@ -374,11 +378,13 @@ class TileLayer(Layer):
374378 Adds the layer as an optional overlay (True) or the base layer (False).
375379 control : bool, default True
376380 Whether the Layer will be included in LayerControls.
381+ subdomains: string, default 'abc'
382+ Subdomains of the tile service.
377383 """
378384 def __init__ (self , tiles = 'OpenStreetMap' , min_zoom = 1 , max_zoom = 18 ,
379385 attr = None , API_key = None , detect_retina = False ,
380386 continuous_world = False , name = None , overlay = False ,
381- control = True , no_wrap = False ):
387+ control = True , no_wrap = False , subdomains = 'abc' ):
382388 self .tile_name = (name if name is not None else
383389 '' .join (tiles .lower ().strip ().split ()))
384390 super (TileLayer , self ).__init__ (name = self .tile_name , overlay = overlay ,
@@ -390,6 +396,7 @@ def __init__(self, tiles='OpenStreetMap', min_zoom=1, max_zoom=18,
390396 self .max_zoom = max_zoom
391397 self .no_wrap = no_wrap
392398 self .continuous_world = continuous_world
399+ self .subdomains = subdomains
393400
394401 self .detect_retina = detect_retina
395402
@@ -424,7 +431,8 @@ def __init__(self, tiles='OpenStreetMap', min_zoom=1, max_zoom=18,
424431 continuousWorld: {{this.continuous_world.__str__().lower()}},
425432 noWrap: {{this.no_wrap.__str__().lower()}},
426433 attribution: '{{this.attr}}',
427- detectRetina: {{this.detect_retina.__str__().lower()}}
434+ detectRetina: {{this.detect_retina.__str__().lower()}},
435+ subdomains: '{{this.subdomains}}'
428436 }
429437 ).addTo({{this._parent.get_name()}});
430438
0 commit comments