25
25
import branca .element
26
26
27
27
from folium .map import Popup , Marker , FitBounds , FeatureGroup
28
- from folium .features import GeoJson , TopoJson , PolyLine , MultiPolyLine
28
+ from folium .features import GeoJson , TopoJson , PolyLine , MultiPolyLine , RectangleMarker , Polygon
29
29
from folium .plugins import ImageOverlay
30
30
31
31
rootpath = os .path .abspath (os .path .dirname (__file__ ))
@@ -246,7 +246,7 @@ def test_rectangle_marker(self):
246
246
247
247
# Single Rectangle marker.
248
248
bounds = [45.60 , - 122.8 , 45.61 , - 122.7 ]
249
- self .map .add_child (folium . RectangleMarker (bounds = bounds , popup = 'Hi' ))
249
+ self .map .add_child (RectangleMarker (bounds = bounds , popup = 'Hi' ))
250
250
marker = list (self .map ._children .values ())[- 1 ]
251
251
rect_1 = rect_templ .render ({'RectangleMarker' : marker .get_name (),
252
252
'location' : [45.60 , - 122.8 , 45.61 , - 122.7 ],
@@ -259,7 +259,7 @@ def test_rectangle_marker(self):
259
259
260
260
# Second Rectangle marker.
261
261
bounds = [45.70 , - 122.9 , 45.75 , - 122.5 ]
262
- self .map .add_child (folium . RectangleMarker (bounds = bounds , popup = 'Hi' ))
262
+ self .map .add_child (RectangleMarker (bounds = bounds , popup = 'Hi' ))
263
263
marker = list (self .map ._children .values ())[- 1 ]
264
264
rect_2 = rect_templ .render ({'RectangleMarker' : marker .get_name (),
265
265
'location' : [45.70 , - 122.9 , 45.75 , - 122.5 ],
@@ -288,7 +288,7 @@ def test_polygon(self):
288
288
[35.6720 , 139.7606 ],
289
289
[35.6682 , 139.7588 ],
290
290
[35.6663 , 139.7627 ]]
291
- self .map .add_child (folium . Polygon (locations = locations , popup = 'Hi' ))
291
+ self .map .add_child (Polygon (locations = locations , popup = 'Hi' ))
292
292
marker = list (self .map ._children .values ())[- 1 ]
293
293
polygon_1 = polygon_templ .render ({'Polygon' : marker .get_name (),
294
294
'location' : locations ,
@@ -308,9 +308,9 @@ def test_polygon(self):
308
308
[35.5720 , 138.7606 ],
309
309
[35.5682 , 138.7588 ],
310
310
[35.5663 , 138.7627 ]]
311
- self .map .add_child (folium . Polygon (locations = locations , color = 'red' ,
312
- fill_color = 'red' , fill_opacity = 0.7 ,
313
- weight = 3 , popup = 'Hi' ))
311
+ self .map .add_child (Polygon (locations = locations , color = 'red' ,
312
+ fill_color = 'red' , fill_opacity = 0.7 ,
313
+ weight = 3 , popup = 'Hi' ))
314
314
marker = list (self .map ._children .values ())[- 1 ]
315
315
polygon_2 = polygon_templ .render ({'Polygon' : marker .get_name (),
316
316
'location' : locations ,
0 commit comments