|
5 | 5 | from branca.element import CssLink, Figure, JavascriptLink, MacroElement |
6 | 6 |
|
7 | 7 | from folium.folium import Map |
8 | | -from folium.utilities import iter_points, none_max, none_min, parse_options |
| 8 | +from folium.utilities import parse_options, get_bounds |
9 | 9 |
|
10 | 10 | from jinja2 import Template |
11 | 11 |
|
@@ -227,17 +227,4 @@ def _get_self_bounds(self): |
227 | 227 | data = {'type': 'Feature', 'geometry': data} |
228 | 228 | data = {'type': 'FeatureCollection', 'features': [data]} |
229 | 229 |
|
230 | | - bounds = [[None, None], [None, None]] |
231 | | - for feature in data['features']: |
232 | | - for point in iter_points(feature.get('geometry', {}).get('coordinates', {})): # noqa |
233 | | - bounds = [ |
234 | | - [ |
235 | | - none_min(bounds[0][0], point[1]), |
236 | | - none_min(bounds[0][1], point[0]), |
237 | | - ], |
238 | | - [ |
239 | | - none_max(bounds[1][0], point[1]), |
240 | | - none_max(bounds[1][1], point[0]), |
241 | | - ], |
242 | | - ] |
243 | | - return bounds |
| 230 | + return get_bounds(data, lonlat=True) |
0 commit comments