File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
docs/source/api_reference Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,21 @@ Example
9
9
from ipyleaflet import Map, LocalTileLayer
10
10
11
11
m = Map(center=(52.204793, 360.121558), zoom=9)
12
- m.add_layer(LocalTileLayer(url='./ tiles/{z}/{x}/{y}.png'))
12
+ m.add_layer(LocalTileLayer(path=' tiles/{z}/{x}/{y}.png'))
13
13
14
14
m
15
15
16
+ Note that the behavior is different in Jupyter Notebook and in JupyterLab.
17
+
18
+ In the classic Jupyter Notebook, the path is relative to the Notebook you are working on.
19
+
20
+ In JupyterLab, the path is relative to the server (where you started JupyterLab) and you need to prefix the path with "files/".
21
+
16
22
Attributes
17
23
----------
18
24
19
25
=============== ================= =====
20
26
Attribute Default Value Doc
21
27
=============== ================= =====
22
- url "" Relative URL (e.g. '. /tiles/{z}/{x}/{y}.png')
28
+ path "" Relative URL (e.g. 'tiles/{z}/{x}/{y}.png' or 'files /tiles/{z}/{x}/{y}.png' in JupyterLab )
23
29
=============== ================= =====
Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ class TileLayer(RasterLayer):
239
239
attribution = Unicode ('Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors' ).tag (sync = True , o = True )
240
240
detect_retina = Bool (False ).tag (sync = True , o = True )
241
241
no_wrap = Bool (False ).tag (sync = True , o = True )
242
+ tms = Bool (False ).tag (sync = True , o = True )
242
243
243
244
_load_callbacks = Instance (CallbackDispatcher , ())
244
245
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ var LeafletLocalTileLayerModel = LeafletTileLayerModel.extend({
16
16
17
17
var LeafletLocalTileLayerView = LeafletTileLayerView . extend ( {
18
18
create_obj : function ( ) {
19
- this . model . set ( 'url' , window . location . href . replace ( / [ ^ / ] * $ / , '' ) + this . model . get ( 'path' ) ) ;
19
+ this . model . set ( 'url' , this . model . get ( 'path' ) ) ;
20
+ this . model . save_changes ( ) ;
20
21
LeafletLocalTileLayerView . __super__ . create_obj . apply ( this , arguments ) ;
21
22
}
22
23
} ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ var LeafletTileLayerModel = LeafletRasterLayerModel.extend({
16
16
max_zoom : 18 ,
17
17
tile_size : 256 ,
18
18
attribution : 'Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors' ,
19
- detect_retina : false
19
+ detect_retina : false ,
20
+ tms : false ,
20
21
} )
21
22
} ) ;
22
23
You can’t perform that action at this time.
0 commit comments