@@ -152,7 +152,8 @@ def __init__(self, location=None, width='100%', height='100%',
152
152
no_wrap = False , attr = None , min_lat = - 90 , max_lat = 90 ,
153
153
min_lon = - 180 , max_lon = 180 , max_bounds = True ,
154
154
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' ):
156
157
super (LegacyMap , self ).__init__ ()
157
158
self ._name = 'Map'
158
159
self ._env = ENV
@@ -192,7 +193,8 @@ def __init__(self, location=None, width='100%', height='100%',
192
193
self .add_tile_layer (
193
194
tiles = tiles , min_zoom = min_zoom , max_zoom = max_zoom ,
194
195
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
196
198
)
197
199
198
200
self ._template = Template (u"""
@@ -247,7 +249,8 @@ def _repr_html_(self, **kwargs):
247
249
def add_tile_layer (self , tiles = 'OpenStreetMap' , name = None ,
248
250
API_key = None , max_zoom = 18 , min_zoom = 1 ,
249
251
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 ):
251
254
"""
252
255
Add a tile layer to the map. See TileLayer for options.
253
256
@@ -257,6 +260,7 @@ def add_tile_layer(self, tiles='OpenStreetMap', name=None,
257
260
attr = attr , API_key = API_key ,
258
261
detect_retina = detect_retina ,
259
262
continuous_world = continuous_world ,
263
+ subdomains = subdomains ,
260
264
no_wrap = no_wrap )
261
265
self .add_child (tile_layer , name = tile_layer .tile_name )
262
266
@@ -374,11 +378,13 @@ class TileLayer(Layer):
374
378
Adds the layer as an optional overlay (True) or the base layer (False).
375
379
control : bool, default True
376
380
Whether the Layer will be included in LayerControls.
381
+ subdomains: string, default 'abc'
382
+ Subdomains of the tile service.
377
383
"""
378
384
def __init__ (self , tiles = 'OpenStreetMap' , min_zoom = 1 , max_zoom = 18 ,
379
385
attr = None , API_key = None , detect_retina = False ,
380
386
continuous_world = False , name = None , overlay = False ,
381
- control = True , no_wrap = False ):
387
+ control = True , no_wrap = False , subdomains = 'abc' ):
382
388
self .tile_name = (name if name is not None else
383
389
'' .join (tiles .lower ().strip ().split ()))
384
390
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,
390
396
self .max_zoom = max_zoom
391
397
self .no_wrap = no_wrap
392
398
self .continuous_world = continuous_world
399
+ self .subdomains = subdomains
393
400
394
401
self .detect_retina = detect_retina
395
402
@@ -424,7 +431,8 @@ def __init__(self, tiles='OpenStreetMap', min_zoom=1, max_zoom=18,
424
431
continuousWorld: {{this.continuous_world.__str__().lower()}},
425
432
noWrap: {{this.no_wrap.__str__().lower()}},
426
433
attribution: '{{this.attr}}',
427
- detectRetina: {{this.detect_retina.__str__().lower()}}
434
+ detectRetina: {{this.detect_retina.__str__().lower()}},
435
+ subdomains: '{{this.subdomains}}'
428
436
}
429
437
).addTo({{this._parent.get_name()}});
430
438
0 commit comments