Skip to content

Commit dcaae30

Browse files
author
Martin Journois
committed
Apply @ocefpaf's <<suggestions>> 😉
1 parent 24d2973 commit dcaae30

4 files changed

Lines changed: 35 additions & 39 deletions

File tree

folium/features.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class WmsTileLayer(Layer):
2222
def __init__(self, url, format=None, layers=None,
2323
transparent=True, attr=None,
2424
name=None, overlay=True, control=True):
25-
"""Creates a Layer based on a WMS (Web map service).
25+
"""Creates a Web Map Service (WMS) layer.
2626
2727
Parameters
2828
----------
@@ -40,11 +40,11 @@ def __init__(self, url, format=None, layers=None,
4040
name : string, default None
4141
The name of the Layer, as it will appear in LayerControls
4242
overlay : bool, default False
43-
Whether the layer is optional (overlay) or compulsory.
43+
Adds the layer as an optional overlay (True) or the base layer (False).
4444
control : bool, default True
4545
Whether the Layer will be included in LayerControls
4646
"""
47-
super(WmsTileLayer, self).__init__(overlay=overlay, control=control)
47+
super(WmsTileLayer, self).__init__(overlay=overlay, control=control, name=name)
4848
self._name = 'WmsTileLayer'
4949
self.tile_name = name if name is not None else 'WmsTileLayer_'+self._id
5050
self.url = url
@@ -163,17 +163,17 @@ def __init__(self, data, width=None, height=None,
163163
width: int or str, default None
164164
The width of the output element.
165165
If None, either data['width'] (if available) or '100%' will be used.
166-
Ex: 120 , '120px', '80%'
166+
Ex: 120, '120px', '80%'
167167
height: int or str, default None
168168
The height of the output element.
169169
If None, either data['width'] (if available) or '100%' will be used.
170-
Ex: 120 , '120px', '80%'
170+
Ex: 120, '120px', '80%'
171171
left: int or str, default '0%'
172172
The horizontal distance of the output with respect to the parent HTML object.
173-
Ex: 120 , '120px', '80%'
173+
Ex: 120, '120px', '80%'
174174
top: int or str, default '0%'
175175
The vertical distance of the output with respect to the parent HTML object.
176-
Ex: 120 , '120px', '80%'
176+
Ex: 120, '120px', '80%'
177177
position: str, default 'relative'
178178
The `position` argument that the CSS shall contain.
179179
Ex: 'relative', 'absolute'
@@ -256,7 +256,7 @@ def __init__(self, data, style_function=None, name=None, overlay=True, control=T
256256
name : string, default None
257257
The name of the Layer, as it will appear in LayerControls
258258
overlay : bool, default False
259-
Whether the layer is optional (overlay) or compulsory.
259+
Adds the layer as an optional overlay (True) or the base layer (False).
260260
control : bool, default True
261261
Whether the Layer will be included in LayerControls
262262
@@ -383,7 +383,7 @@ def __init__(self, data, object_path, style_function=None,
383383
name : string, default None
384384
The name of the Layer, as it will appear in LayerControls
385385
overlay : bool, default False
386-
Whether the layer is optional (overlay) or compulsory.
386+
Adds the layer as an optional overlay (True) or the base layer (False).
387387
control : bool, default True
388388
Whether the Layer will be included in LayerControls
389389
@@ -498,7 +498,7 @@ def __init__(self, name=None, overlay=True, control=True):
498498
name : string, default None
499499
The name of the Layer, as it will appear in LayerControls
500500
overlay : bool, default False
501-
Whether the layer is optional (overlay) or compulsory.
501+
Adds the layer as an optional overlay (True) or the base layer (False).
502502
control : bool, default True
503503
Whether the Layer will be included in LayerControls
504504
"""

folium/folium.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def simple_marker(self, location=None, popup=None,
101101
102102
Example
103103
-------
104-
>>>map.simple_marker(location=[45.5, -122.3], popup='Portland, OR')
105-
>>>map.simple_marker(location=[45.5, -122.3], popup=(vis, 'vis.json'))
104+
>>> map.simple_marker(location=[45.5, -122.3], popup='Portland, OR')
105+
>>> map.simple_marker(location=[45.5, -122.3], popup=(vis, 'vis.json'))
106106
107107
"""
108108
warnings.warn("%s is deprecated. Use %s instead" %
@@ -157,9 +157,9 @@ def line(self, locations,
157157
158158
Example
159159
-------
160-
>>>map.line(locations=[(45.5, -122.3), (42.3, -71.0)])
161-
>>>map.line(locations=[(45.5, -122.3), (42.3, -71.0)],
162-
line_color='red', line_opacity=1.0)
160+
>>> map.line(locations=[(45.5, -122.3), (42.3, -71.0)])
161+
>>> map.line(locations=[(45.5, -122.3), (42.3, -71.0)],
162+
line_color='red', line_opacity=1.0)
163163
164164
"""
165165
warnings.warn("%s is deprecated. Use %s instead" %
@@ -261,10 +261,10 @@ def circle_marker(self, location=None, radius=500, popup=None,
261261
262262
Example
263263
-------
264-
>>>map.circle_marker(location=[45.5, -122.3],
265-
radius=1000, popup='Portland, OR')
266-
>>>map.circle_marker(location=[45.5, -122.3],
267-
radius=1000, popup=(bar_chart, 'bar_data.json'))
264+
>>> map.circle_marker(location=[45.5, -122.3],
265+
radius=1000, popup='Portland, OR')
266+
>>> map.circle_marker(location=[45.5, -122.3],
267+
radius=1000, popup=(bar_chart, 'bar_data.json'))
268268
269269
"""
270270
warnings.warn("%s is deprecated. Use %s instead" %
@@ -366,7 +366,7 @@ def click_for_marker(self, popup=None):
366366
367367
Example
368368
-------
369-
>>>map.click_for_marker(popup='Your Custom Text')
369+
>>> map.click_for_marker(popup='Your Custom Text')
370370
371371
"""
372372
warnings.warn("%s is deprecated. Use %s instead" %
@@ -510,11 +510,11 @@ def choropleth(self, geo_path=None, geo_str=None, data_out='data.json',
510510
Example
511511
-------
512512
>>> m.choropleth(geo_path='us-states.json', line_color='blue',
513-
line_weight=3)
513+
line_weight=3)
514514
>>> m.choropleth(geo_path='geo.json', data=df,
515-
columns=['Data 1', 'Data 2'],
516-
key_on='feature.properties.myvalue', fill_color='PuBu',
517-
threshold_scale=[0, 20, 30, 40, 50, 60])
515+
columns=['Data 1', 'Data 2'],
516+
key_on='feature.properties.myvalue', fill_color='PuBu',
517+
threshold_scale=[0, 20, 30, 40, 50, 60])
518518
>>> m.choropleth(geo_path='countries.json',
519519
... topojson='objects.countries')
520520

folium/map.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ def __init__(self, location=None, width='100%', height='100%',
8989
9090
Examples
9191
--------
92-
>>>map = folium.LegacyMap(location=[45.523, -122.675], width=750, height=500)
93-
>>>map = folium.LegacyMap(location=[45.523, -122.675],
94-
tiles='Mapbox Control Room')
95-
>>>map = folium.LegacyMap(location=(45.523, -122.675), max_zoom=20,
96-
tiles='Cloudmade', API_key='YourKey')
97-
>>>map = folium.LegacyMap(location=[45.523, -122.675], zoom_start=2,
98-
tiles=('http://{s}.tiles.mapbox.com/v3/'
99-
'mapbox.control-room/{z}/{x}/{y}.png'),
100-
attr='Mapbox attribution')
101-
92+
>>> map = folium.LegacyMap(location=[45.523, -122.675], width=750, height=500)
93+
>>> map = folium.LegacyMap(location=[45.523, -122.675],
94+
tiles='Mapbox Control Room')
95+
>>> map = folium.LegacyMap(location=(45.523, -122.675), max_zoom=20,
96+
tiles='Cloudmade', API_key='YourKey')
97+
>>> map = folium.LegacyMap(location=[45.523, -122.675], zoom_start=2,
98+
tiles=('http://{s}.tiles.mapbox.com/v3/'
99+
'mapbox.control-room/{z}/{x}/{y}.png'),
100+
attr='Mapbox attribution')
102101
"""
103102
super(LegacyMap, self).__init__()
104103
self._name = 'Map'
@@ -206,7 +205,7 @@ def __init__(self, name=None, overlay=False, control=True):
206205
name : string, default None
207206
The name of the Layer, as it will appear in LayerControls
208207
overlay : bool, default False
209-
Whether the layer is optional (overlay) or compulsory.
208+
Adds the layer as an optional overlay (True) or the base layer (False).
210209
control : bool, default True
211210
Whether the Layer will be included in LayerControls.
212211
"""
@@ -253,7 +252,7 @@ def __init__(self, tiles='OpenStreetMap', min_zoom=1, max_zoom=18,
253252
name : string, default None
254253
The name of the Layer, as it will appear in LayerControls
255254
overlay : bool, default False
256-
Whether the layer is optional (overlay) or compulsory.
255+
Adds the layer as an optional overlay (True) or the base layer (False).
257256
control : bool, default True
258257
Whether the Layer will be included in LayerControls.
259258
"""

folium/templates/d3_threshold.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)