@@ -56,8 +56,9 @@ class Map(object):
5656 '''Create a Map with Folium'''
5757
5858 def __init__ (self , location = None , width = 960 , height = 500 ,
59- tiles = 'OpenStreetMap' , API_key = None , max_zoom = 18 ,
60- zoom_start = 10 , attr = None ):
59+ tiles = 'OpenStreetMap' , API_key = None , max_zoom = 18 , min_zoom = 1 ,
60+ zoom_start = 10 , attr = None , min_lat = - 90 , max_lat = 90 ,
61+ min_lon = - 180 , max_lon = 180 ):
6162 '''Create a Map with Folium and Leaflet.js
6263
6364 Generate a base map of given width and height with either default
@@ -139,10 +140,17 @@ def __init__(self, location=None, width=960, height=500,
139140
140141 #Templates
141142 self .env = ENV
142- self .template_vars = {'lat' : location [0 ], 'lon' : location [1 ],
143- 'size' : self ._size , 'max_zoom' : max_zoom ,
144- 'zoom_level' : zoom_start ,
145- 'map_id' : self .map_id }
143+ self .template_vars = dict (lat = location [0 ],
144+ lon = location [1 ],
145+ size = self ._size ,
146+ max_zoom = max_zoom ,
147+ zoom_level = zoom_start ,
148+ map_id = self .map_id ,
149+ min_zoom = min_zoom ,
150+ min_lat = min_lat ,
151+ max_lat = max_lat ,
152+ min_lon = min_lon ,
153+ max_lon = max_lon )
146154
147155 #Tiles
148156 self .tiles = '' .join (tiles .lower ().strip ().split ())
0 commit comments