Test CustomIcon.
(self)
| 439 | assert bounds == [[None, None], [None, None]], bounds |
| 440 | |
| 441 | def test_custom_icon(self): |
| 442 | """Test CustomIcon.""" |
| 443 | icon_image = "http://leafletjs.com/docs/images/leaf-green.png" |
| 444 | shadow_image = "http://leafletjs.com/docs/images/leaf-shadow.png" |
| 445 | |
| 446 | self.m = folium.Map([45, -100], zoom_start=4) |
| 447 | i = folium.features.CustomIcon( |
| 448 | icon_image, |
| 449 | icon_size=(38, 95), |
| 450 | icon_anchor=(22, 94), |
| 451 | shadow_image=shadow_image, |
| 452 | shadow_size=(50, 64), |
| 453 | shadow_anchor=(4, 62), |
| 454 | popup_anchor=(-3, -76), |
| 455 | ) |
| 456 | mk = folium.Marker([45, -100], icon=i, popup=folium.Popup("Hello")) |
| 457 | self.m.add_child(mk) |
| 458 | self.m._parent.render() |
| 459 | |
| 460 | bounds = self.m.get_bounds() |
| 461 | assert bounds == [[45, -100], [45, -100]], bounds |
| 462 | |
| 463 | def test_global_switches(self): |
| 464 | m = folium.Map(prefer_canvas=True) |
nothing calls this directly
no test coverage detected