1010import json
1111import warnings
1212
13- import requests
14- import numpy as np
15-
1613from branca .colormap import LinearColormap , StepColormap
1714from 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
2016
2117from folium .folium import Map
2218from 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+ )
2527from folium .vector_layers import PolyLine
2628
2729from jinja2 import Template
2830
31+ import numpy as np
32+
33+ import requests
34+
2935from six import binary_type , text_type
3036
3137
@@ -84,7 +90,7 @@ def __init__(self, location, color='black', opacity=1, weight=2,
8490 fill_color = 'blue' , fill_opacity = 1 , number_of_sides = 4 ,
8591 rotation = 0 , radius = 15 , popup = None , tooltip = None ):
8692 super (RegularPolygonMarker , self ).__init__ (
87- _locations_tolist (location ),
93+ _iter_tolist (location ),
8894 popup = popup , tooltip = tooltip
8995 )
9096 self ._name = 'RegularPolygonMarker'
@@ -684,26 +690,26 @@ def __init__(self, fields, aliases=None, labels=True,
684690 super (GeoJsonTooltip , self ).__init__ (
685691 text = '' , style = style , sticky = sticky , ** kwargs
686692 )
687- self ._name = " GeoJsonTooltip"
693+ self ._name = ' GeoJsonTooltip'
688694
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.'
691697 if aliases is not None :
692698 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.'
699705
700706 self .fields = fields
701707 self .aliases = aliases
702708 self .labels = labels
703709 self .localize = localize
704710 if style :
705711 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.'
707713 # noqa outside of type checking.
708714 self .style = style
709715
@@ -720,8 +726,8 @@ def render(self, **kwargs):
720726 'than a GeoJson or TopoJson object.' )
721727 keys = tuple (x for x in keys if x not in ('style' , 'highlight' ))
722728 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 ))
725731 super (GeoJsonTooltip , self ).render (** kwargs )
726732
727733
0 commit comments