Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1001,7 +1001,7 @@ def create_ride_map():
|
|
| 1001 |
|
| 1002 |
m = folium.Map(location=[(origin[0] + destination[0]) / 2, (origin[1] + destination[1]) / 2], zoom_start=13)
|
| 1003 |
|
| 1004 |
-
|
| 1005 |
|
| 1006 |
# مبدأ: آیکون دایره (با icon='circle')
|
| 1007 |
folium.Marker(
|
|
@@ -1010,24 +1010,33 @@ def create_ride_map():
|
|
| 1010 |
icon=folium.Icon(color="purple", icon="circle", prefix="fa")
|
| 1011 |
).add_to(m)
|
| 1012 |
|
| 1013 |
-
|
| 1014 |
folium.Marker(
|
| 1015 |
-
location=
|
|
|
|
| 1016 |
icon=folium.DivIcon(
|
| 1017 |
html=f"""
|
| 1018 |
-
<div style="
|
| 1019 |
-
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
|
| 1028 |
-
|
| 1029 |
-
|
| 1030 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1031 |
</div>
|
| 1032 |
"""
|
| 1033 |
)
|
|
@@ -1040,33 +1049,43 @@ def create_ride_map():
|
|
| 1040 |
icon=folium.Icon(color="purple", icon="flag", prefix="fa")
|
| 1041 |
).add_to(m)
|
| 1042 |
|
| 1043 |
-
#
|
| 1044 |
folium.Marker(
|
| 1045 |
-
location=
|
|
|
|
| 1046 |
icon=folium.DivIcon(
|
| 1047 |
html=f"""
|
| 1048 |
-
<div style="
|
| 1049 |
-
|
| 1050 |
-
|
| 1051 |
-
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
|
| 1057 |
-
|
| 1058 |
-
|
| 1059 |
-
|
| 1060 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1061 |
</div>
|
| 1062 |
"""
|
| 1063 |
)
|
| 1064 |
).add_to(m)
|
| 1065 |
|
| 1066 |
-
# خط مسیر
|
| 1067 |
folium.PolyLine(
|
| 1068 |
[origin, destination],
|
| 1069 |
-
color=
|
| 1070 |
weight=4,
|
| 1071 |
opacity=0.8,
|
| 1072 |
dash_array="5,5"
|
|
|
|
| 1001 |
|
| 1002 |
m = folium.Map(location=[(origin[0] + destination[0]) / 2, (origin[1] + destination[1]) / 2], zoom_start=13)
|
| 1003 |
|
| 1004 |
+
purple = "#6a0dad"
|
| 1005 |
|
| 1006 |
# مبدأ: آیکون دایره (با icon='circle')
|
| 1007 |
folium.Marker(
|
|
|
|
| 1010 |
icon=folium.Icon(color="purple", icon="circle", prefix="fa")
|
| 1011 |
).add_to(m)
|
| 1012 |
|
| 1013 |
+
# مبدأ - دایره + لیبل
|
| 1014 |
folium.Marker(
|
| 1015 |
+
location=origin,
|
| 1016 |
+
tooltip="مبدا",
|
| 1017 |
icon=folium.DivIcon(
|
| 1018 |
html=f"""
|
| 1019 |
+
<div style="display: flex; align-items: center; direction: rtl;">
|
| 1020 |
+
<div style="
|
| 1021 |
+
width: 12px;
|
| 1022 |
+
height: 12px;
|
| 1023 |
+
background-color: {purple};
|
| 1024 |
+
border-radius: 50%;
|
| 1025 |
+
margin-left: 6px;
|
| 1026 |
+
"></div>
|
| 1027 |
+
<div style="
|
| 1028 |
+
background-color: white;
|
| 1029 |
+
border: 2px solid {purple};
|
| 1030 |
+
border-radius: 6px;
|
| 1031 |
+
padding: 2px 8px;
|
| 1032 |
+
color: {purple};
|
| 1033 |
+
font-weight: bold;
|
| 1034 |
+
font-size: 13px;
|
| 1035 |
+
font-family: sans-serif;
|
| 1036 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
|
| 1037 |
+
">
|
| 1038 |
+
مبدا
|
| 1039 |
+
</div>
|
| 1040 |
</div>
|
| 1041 |
"""
|
| 1042 |
)
|
|
|
|
| 1049 |
icon=folium.Icon(color="purple", icon="flag", prefix="fa")
|
| 1050 |
).add_to(m)
|
| 1051 |
|
| 1052 |
+
# مقصد - آیکون پرچم + لیبل
|
| 1053 |
folium.Marker(
|
| 1054 |
+
location=destination,
|
| 1055 |
+
tooltip="مقصد",
|
| 1056 |
icon=folium.DivIcon(
|
| 1057 |
html=f"""
|
| 1058 |
+
<div style="display: flex; align-items: center; direction: rtl;">
|
| 1059 |
+
<div style="
|
| 1060 |
+
width: 0;
|
| 1061 |
+
height: 0;
|
| 1062 |
+
border-left: 8px solid {purple};
|
| 1063 |
+
border-top: 6px solid transparent;
|
| 1064 |
+
border-bottom: 6px solid transparent;
|
| 1065 |
+
margin-left: 6px;
|
| 1066 |
+
"></div>
|
| 1067 |
+
<div style="
|
| 1068 |
+
background-color: white;
|
| 1069 |
+
border: 2px solid {purple};
|
| 1070 |
+
border-radius: 6px;
|
| 1071 |
+
padding: 2px 8px;
|
| 1072 |
+
color: {purple};
|
| 1073 |
+
font-weight: bold;
|
| 1074 |
+
font-size: 13px;
|
| 1075 |
+
font-family: sans-serif;
|
| 1076 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
|
| 1077 |
+
">
|
| 1078 |
+
مقصد
|
| 1079 |
+
</div>
|
| 1080 |
</div>
|
| 1081 |
"""
|
| 1082 |
)
|
| 1083 |
).add_to(m)
|
| 1084 |
|
| 1085 |
+
# خط بین مسیر
|
| 1086 |
folium.PolyLine(
|
| 1087 |
[origin, destination],
|
| 1088 |
+
color=purple,
|
| 1089 |
weight=4,
|
| 1090 |
opacity=0.8,
|
| 1091 |
dash_array="5,5"
|