Added ability to use remote URL for GeoJSON
@@ -15,6 +15,7 @@ from branca.utilities import color_brewer
from .map import LegacyMap, FitBounds
from .features import GeoJson, TopoJson
+import requests
class Map(LegacyMap):
"""Create a Map with Folium and Leaflet.js
@@ -251,6 +252,10 @@ class Map(LegacyMap):
# Create GeoJson object
if geo_path:
+ print("Using new folium")
+ if geo_path.lower().startswith(('http','ftp','https')):
+ geo_data = requests.get(geo_path).json()
+ else:
geo_data = open(geo_path)
elif geo_str:
geo_data = geo_str
