-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugAn issue describing unexpected or malicious behaviourAn issue describing unexpected or malicious behaviour
Description
This works just fine in an ipython notebook
m = folium.Map([0, 0], zoom_start=7)
folium.TopoJson(
{
"type":"Topology",
"transform":{
"scale": [1,1],
"translate": [0,0]
},
"objects":{
"two_squares":{
"type": "GeometryCollection",
"geometries":[
{"type": "Polygon", "arcs":[[0,1]],"properties": {"name": "Left_Polygon" }},
{"type": "Polygon", "arcs":[[2,-1]],"properties": {"name": "Right_Polygon" }}
]
}
},
"arcs": [
[[1,2],[0,-2]],
[[1,0],[-1,0],[0,2],[1,0]],
[[1,2],[1,0],[0,-2],[-1,0]]
]
},
object_path='objects.two_squares'
).add_to(m)
m
but changing the object to include a -
renders the map, but not the polygons
m = folium.Map([0, 0], zoom_start=7)
folium.TopoJson(
{
"type":"Topology",
"transform":{
"scale": [1,1],
"translate": [0,0]
},
"objects":{
"two-squares":{
"type": "GeometryCollection",
"geometries":[
{"type": "Polygon", "arcs":[[0,1]],"properties": {"name": "Left_Polygon" }},
{"type": "Polygon", "arcs":[[2,-1]],"properties": {"name": "Right_Polygon" }}
]
}
},
"arcs": [
[[1,2],[0,-2]],
[[1,0],[-1,0],[0,2],[1,0]],
[[1,2],[1,0],[0,-2],[-1,0]]
]
},
object_path='objects.two-squares'
).add_to(m)
m
Problem description
Literally took me 3 hours to diagnose, as the first topojson file I ever tried to render used -
s
Expected Output
Ideal fix would just be to render all objects, as there is no topojson specification that precludes -
s. Consolation prize would be a friendly error message when object_path
contains a -
Output of folium.__version__
0.5.0
Metadata
Metadata
Assignees
Labels
bugAn issue describing unexpected or malicious behaviourAn issue describing unexpected or malicious behaviour