10
10
import json
11
11
import warnings
12
12
13
- import requests
14
- import numpy as np
15
-
16
13
from branca .colormap import LinearColormap , StepColormap
17
14
from branca .element import (Element , Figure , JavascriptLink , MacroElement )
18
- from branca .utilities import (_locations_tolist , _parse_size , image_to_url ,
19
- none_max , none_min , color_brewer )
15
+ from branca .utilities import color_brewer
20
16
21
17
from folium .folium import Map
22
18
from folium .map import (FeatureGroup , Icon , Layer , Marker , Tooltip )
23
-
24
- from folium .utilities import get_bounds
19
+ from folium .utilities import (
20
+ _iter_tolist ,
21
+ _parse_size ,
22
+ get_bounds ,
23
+ image_to_url ,
24
+ none_max ,
25
+ none_min ,
26
+ )
25
27
from folium .vector_layers import PolyLine
26
28
27
29
from jinja2 import Template
28
30
31
+ import numpy as np
32
+
33
+ import requests
34
+
29
35
from six import binary_type , text_type
30
36
31
37
@@ -84,7 +90,7 @@ def __init__(self, location, color='black', opacity=1, weight=2,
84
90
fill_color = 'blue' , fill_opacity = 1 , number_of_sides = 4 ,
85
91
rotation = 0 , radius = 15 , popup = None , tooltip = None ):
86
92
super (RegularPolygonMarker , self ).__init__ (
87
- _locations_tolist (location ),
93
+ _iter_tolist (location ),
88
94
popup = popup , tooltip = tooltip
89
95
)
90
96
self ._name = 'RegularPolygonMarker'
@@ -684,26 +690,26 @@ def __init__(self, fields, aliases=None, labels=True,
684
690
super (GeoJsonTooltip , self ).__init__ (
685
691
text = '' , style = style , sticky = sticky , ** kwargs
686
692
)
687
- self ._name = " GeoJsonTooltip"
693
+ self ._name = ' GeoJsonTooltip'
688
694
689
- assert isinstance (fields , (list , tuple )), " Please pass a list or " \
690
- " tuple to fields."
695
+ assert isinstance (fields , (list , tuple )), ' Please pass a list or ' \
696
+ ' tuple to fields.'
691
697
if aliases is not None :
692
698
assert isinstance (aliases , (list , tuple ))
693
- assert len (fields ) == len (aliases ), " fields and aliases must have" \
694
- " the same length."
695
- assert isinstance (labels , bool ), " labels requires a boolean value."
696
- assert isinstance (localize , bool ), " localize must be bool."
697
- assert 'permanent' not in kwargs , " The `permanent` option does not " \
698
- " work with GeoJsonTooltip."
699
+ assert len (fields ) == len (aliases ), ' fields and aliases must have' \
700
+ ' the same length.'
701
+ assert isinstance (labels , bool ), ' labels requires a boolean value.'
702
+ assert isinstance (localize , bool ), ' localize must be bool.'
703
+ assert 'permanent' not in kwargs , ' The `permanent` option does not ' \
704
+ ' work with GeoJsonTooltip.'
699
705
700
706
self .fields = fields
701
707
self .aliases = aliases
702
708
self .labels = labels
703
709
self .localize = localize
704
710
if style :
705
711
assert isinstance (style , str ), \
706
- " Pass a valid inline HTML style property string to style."
712
+ ' Pass a valid inline HTML style property string to style.'
707
713
# noqa outside of type checking.
708
714
self .style = style
709
715
@@ -720,8 +726,8 @@ def render(self, **kwargs):
720
726
'than a GeoJson or TopoJson object.' )
721
727
keys = tuple (x for x in keys if x not in ('style' , 'highlight' ))
722
728
for value in self .fields :
723
- assert value in keys , (" The field {} is not available in the data. "
724
- " Choose from: {}." .format (value , keys ))
729
+ assert value in keys , (' The field {} is not available in the data. '
730
+ ' Choose from: {}.' .format (value , keys ))
725
731
super (GeoJsonTooltip , self ).render (** kwargs )
726
732
727
733
0 commit comments