Skip to content

Commit 9c4dcb2

Browse files
committed
Merge pull request #330 from ocefpaf/no_tiles
Add a "no tiles" option
2 parents 6c2c96f + 0f78996 commit 9c4dcb2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

folium/map.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def __init__(self, location=None, width='100%', height='100%',
5050
height: pixel int or percentage string (default: '100%')
5151
Height of the map.
5252
tiles: str, default 'OpenStreetMap'
53-
Map tileset to use. Can use defaults or pass a custom URL.
53+
Map tileset to use. Can choose from a list of built-in tiles,
54+
pass a custom URL or pass `None` to create a map without tiles.
5455
API_key: str, default None
5556
API key for Cloudmade or Mapbox tiles.
5657
max_zoom: int, default 18
@@ -122,9 +123,10 @@ def __init__(self, location=None, width='100%', height='100%',
122123

123124
self.crs = crs
124125

125-
self.add_tile_layer(tiles=tiles, min_zoom=min_zoom, max_zoom=max_zoom,
126-
attr=attr, API_key=API_key,
127-
detect_retina=detect_retina)
126+
if tiles:
127+
self.add_tile_layer(tiles=tiles, min_zoom=min_zoom, max_zoom=max_zoom,
128+
attr=attr, API_key=API_key,
129+
detect_retina=detect_retina)
128130

129131
self._template = Template(u"""
130132
{% macro header(this, kwargs) %}

0 commit comments

Comments
 (0)