Skip to content

Commit d1a3f9b

Browse files
committed
Add bounds attribute to TileLayer
1 parent cfb3669 commit d1a3f9b

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

docs/source/api_reference/tile_layer.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ min_zoom 0
4242
max_zoom 18
4343
min_native_zoom 0
4444
max_native_zoom 18
45+
bounds None
4546
tile_size 256
4647
attribution "Map data (c) <a href=\'https://openstreetmap.org\'>OpenStreetMap</a> contributors"
4748
detect_retina False

ipyleaflet/leaflet.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ class TileLayer(RasterLayer):
529529
Minimum zoom for this tile service.
530530
max_zoom: int, default 18
531531
Maximum zoom for this tile service.
532+
bounds: list or None, default None
533+
List of SW and NE location tuples. e.g. [(50, 75), (75, 120)].
532534
tile_size int, default 256
533535
Tile sizes for this tile service.
534536
attribution string, default "Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors"
@@ -552,6 +554,7 @@ class TileLayer(RasterLayer):
552554
max_zoom = Int(18).tag(sync=True, o=True)
553555
min_native_zoom = Int(0).tag(sync=True, o=True)
554556
max_native_zoom = Int(18).tag(sync=True, o=True)
557+
bounds = List(default_value=None, allow_none=True, help='list of SW and NE location tuples').tag(sync=True, o=True)
555558
tile_size = Int(256).tag(sync=True, o=True)
556559
attribution = Unicode('Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors').tag(
557560
sync=True, o=True)

js/src/layers/TileLayer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export class LeafletTileLayerModel extends rasterlayer.LeafletRasterLayerModel {
1515
url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
1616
min_zoom: 0,
1717
max_zoom: 18,
18+
bounds: null,
1819
tile_size: 256,
1920
attribution:
2021
'Map data (c) <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',

0 commit comments

Comments
 (0)