Skip to content

Commit 4fcae97

Browse files
committed
defer get_bounds
1 parent 5fc7fef commit 4fcae97

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

folium/map.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from branca.element import CssLink, Element, Figure, Html, JavascriptLink, MacroElement # noqa
2121
from branca.utilities import _parse_size
2222

23-
from folium.utilities import _validate_coordinates, _validate_location
23+
from folium.utilities import _validate_coordinates, _validate_location, get_bounds
2424

2525
from jinja2 import Environment, PackageLoader, Template
2626

@@ -656,7 +656,7 @@ def __init__(self, location, popup=None, icon=None):
656656
{% macro script(this, kwargs) %}
657657
658658
var {{this.get_name()}} = L.marker(
659-
[{{this.location[0]}},{{this.location[1]}}],
659+
[{{this.location[0]}}, {{this.location[1]}}],
660660
{
661661
icon: new L.Icon.Default()
662662
}
@@ -666,11 +666,12 @@ def __init__(self, location, popup=None, icon=None):
666666
""")
667667

668668
def _get_self_bounds(self):
669-
"""Computes the bounds of the object itself (not including it's children)
670-
in the form [[lat_min, lon_min], [lat_max, lon_max]]
671669
"""
672-
return [[self.location[0], self.location[1]],
673-
[self.location[0], self.location[1]]]
670+
Computes the bounds of the object itself (not including it's children)
671+
in the form [[lat_min, lon_min], [lat_max, lon_max]].
672+
673+
"""
674+
return get_bounds(self.location)
674675

675676

676677
class Popup(Element):

0 commit comments

Comments
 (0)