Skip to content

Commit 3273696

Browse files
authored
Merge pull request #907 from davidbrochart/tilelayer_bounds
Add bounds attribute to TileLayer
2 parents cfb3669 + e6bce26 commit 3273696

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
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',

ui-tests/notebooks/SplitMapControl.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": [
1010
"from ipyleaflet import Map, basemaps, basemap_to_tiles, SplitMapControl\n",
1111
"\n",
12-
"m = Map(center=(42.6824, 365.581), zoom=5)\n",
12+
"m = Map(center=(44.15, 359.475), zoom=6)\n",
1313
"control = SplitMapControl()\n",
1414
"m.add_control(control)\n",
1515
"\n",
33.3 KB
Loading

0 commit comments

Comments
 (0)