2016-08-23 6 views
5

나는 4.2.1Folium 맵에 화살촉이있는 선을 그릴 수 있습니까?

내가 전달하는 화살표가지도에 선을, 플롯하려고 Jupyter 노트북 서버에 파이썬 2.7.11로 Folium 0.2.1 '를 실행하고 방향

import folium 

#DFW, LGA coordinates 
coordinates=[(32.900908, -97.040335),(40.768571, -73.861603)] 

m = folium.Map(location=[32.900908, -97.040335], zoom_start=4) 

#line going from dfw to lga 
aline=folium.PolyLine(locations=coordinates,weight=2,color = 'blue') 
m.add_children(aline) 

enter image description here 줄에 화살촉을 추가하는 방법이 있습니까? 당신은 끝 지점에서 삼각형을 그릴 정다각형 마커를 사용할 수

답변

1

...

folium.RegularPolygonMarker(location=(32.900908, -97.040335), fill_color='blue', number_of_sides=3, radius=10, rotation=???).add_to(m) 

당신은에 가리 키도록 삼각형의 회전 각도를 계산하는 몇 가지 삼각법을 사용해야합니다 올바른 방향. 그러한 마커의 초기 지점은 동쪽으로 향합니다.

관련 문제